Getting Started With Lens Protocol As A Frontend Developer
It is safe to say that Lens Protocol has been the talk of the town for these past few months in web3. It is the closest thing we have to a decentralized and composable social graph.
The Lens team has conveniently made available an API that indexes al...
ankr.hashnode.dev11 min read
The apollo client configuration seems to be changed a bit now.
import { ApolloClient, createHttpLink, gql, InMemoryCache, } from "@apollo/client"; import { setContext } from "@apollo/client/link/context"; const API_URL = "YOUR_URL"; const httpLink = createHttpLink({ uri: API_URL }); const authLink = setContext((_, { headers }) => { const token = localStorage.getItem("access_token"); return { headers: { ...headers, "x-access-token": token ? `Bearer ${token}` : "", }, }; }); export const apolloClient = new ApolloClient({ link: authLink.concat(httpLink), cache: new InMemoryCache(), });