Skip to content

Instantly share code, notes, and snippets.

View exisz's full-sized avatar
🦞
pew pew

Exis exisz

🦞
pew pew
View GitHub Profile
import ApolloClient from 'apollo-boost';
const client = new ApolloClient({
uri: '<your graphql endpoint>',
// Apollo Boost allows you to specify a custom error link for your client
onError: ({ graphQLErrors, networkError, operation, forward }) => {
if (graphQLErrors) {
for (let err of graphQLErrors) {
// handle errors differently based on its error code
switch (err.extensions.code) {