diff --git a/client/src/graphql/client.js b/client/src/graphql/client.js index 5cdcdab8..0fc0a21a 100644 --- a/client/src/graphql/client.js +++ b/client/src/graphql/client.js @@ -44,10 +44,10 @@ export default function (uri, networkErrorCallback) { }); const errorLink = onError(({networkError, graphQLErrors, forward, operation}) => { - // const observable = forward(operation); + const observable = forward(operation); if (networkError && networkErrorCallback) { networkErrorCallback(networkError.statusCode); - // return observable; + return observable; } if (graphQLErrors) { @@ -63,16 +63,25 @@ export default function (uri, networkErrorCallback) { */ if (networkError && networkError.name === 'ServerParseError') { // workaround found here: https://github.com/apollographql/apollo-link/issues/855#issuecomment-485764697 - // return observable; + return observable; } }); - const composedLink = ApolloLink.from([ - consoleLink, - createOmitTypenameLink, - errorLink, - httpLink - ]); + let composedLink; + if (process.env.NODE_ENV === 'production') { + composedLink = ApolloLink.from([ + createOmitTypenameLink, + errorLink, + httpLink + ]); + } else { + composedLink = ApolloLink.from([ + consoleLink, + createOmitTypenameLink, + errorLink, + httpLink + ]); + } // Create the apollo client return new ApolloClient({