Created
March 4, 2018 07:39
-
-
Save akoenig/56ad87d28bd786c0511fd7eb868ac3bb to your computer and use it in GitHub Desktop.
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
| // 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