Skip to content

Instantly share code, notes, and snippets.

@akoenig
Created March 4, 2018 07:39
Show Gist options
  • Select an option

  • Save akoenig/56ad87d28bd786c0511fd7eb868ac3bb to your computer and use it in GitHub Desktop.

Select an option

Save akoenig/56ad87d28bd786c0511fd7eb868ac3bb to your computer and use it in GitHub Desktop.
// graphql/index.js
import ApolloClient, { createNetworkInterface } from "react-apollo";
const createClient = ({ endpointUri: uri }) => {
const networkInterface = createNetworkInterface({ uri });
networkInterface.useAfter([{
applyAfterware({ response }, next) {
// Do something with the response ...
next();
}
}]);
return new ApolloClient({ networkInterface });
};
export { createClient };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment