Skip to content

Instantly share code, notes, and snippets.

@brunokrebs
Created December 17, 2018 11:12
Show Gist options
  • Save brunokrebs/9d75dc3832d4c7d15d925da26f285bfe to your computer and use it in GitHub Desktop.
Save brunokrebs/9d75dc3832d4c7d15d925da26f285bfe to your computer and use it in GitHub Desktop.
const client = new ApolloClient({
uri: "http://localhost:4000/graphql",
request: operation => {
operation.setContext(context => ({
headers: {
...context.headers,
authorization: "Bearer " + auth.getIdToken(),
},
}));
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment