Skip to content

Instantly share code, notes, and snippets.

View gotexis's full-sized avatar
🤪
Establishing the new world order

Exis gotexis

🤪
Establishing the new world order
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) {