Created
March 31, 2018 17:25
-
-
Save jason-shen/d3ad5ff901d1cbf7374e2fe87fc40378 to your computer and use it in GitHub Desktop.
apollo client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const client = new ApolloClient({ | |
| link: ApolloLink.from([ | |
| onError(({ graphQLErrors, networkError }) => { | |
| if (graphQLErrors) { | |
| graphQLErrors.map(({ message, locations, path }) => | |
| console.log( | |
| `[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`, | |
| ), | |
| ); | |
| } | |
| if (networkError) console.log(`[Network error]: ${networkError}`); | |
| }), | |
| authLink.concat(httpLink), | |
| ]), | |
| cache, | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment