Skip to content

Instantly share code, notes, and snippets.

@himanshu-dixit
Created December 15, 2018 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save himanshu-dixit/d6d337da7e9118399c675720a289814d to your computer and use it in GitHub Desktop.
Save himanshu-dixit/d6d337da7e9118399c675720a289814d to your computer and use it in GitHub Desktop.
...
constructor(props) {
super(props);
const ACCESS_TOKEN = localStorage.getItem('access_token');
this.client = new ApolloClient({
uri: "https://himanshu-todo.herokuapp.com/v1alpha1/graphql",
headers: {
'Authorization': `Bearer ${ACCESS_TOKEN}`,
}
});
}
...
render() {
return (
<div>
<ApolloProvider client={this.client}>
</ApolloProvider>
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment