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
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) { |