Hello anyone here already uses apollo-upload-client
?
i am having a hard time figuring out how to implement it into my app.
const authLink = setContext((_, { headers }) => {
const token = localStorage.getItem(‘token’);
return {
headers: {
…headers,
authorization: token ?Bearer ${token}
: “”,
}
}
});const link = new createUploadLink({ uri: ‘/graphiql’ })
const client = new ApolloClient({
link: authLink.concat(link),
cache: new InMemoryCache(),
});