Skip to content

Instantly share code, notes, and snippets.

@jason-shen
Created March 31, 2018 17:25
Show Gist options
  • Select an option

  • Save jason-shen/d3ad5ff901d1cbf7374e2fe87fc40378 to your computer and use it in GitHub Desktop.

Select an option

Save jason-shen/d3ad5ff901d1cbf7374e2fe87fc40378 to your computer and use it in GitHub Desktop.
apollo client
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