Skip to content

Instantly share code, notes, and snippets.

@stubailo
Created November 26, 2018 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stubailo/c010ba4d947928da769e0f5acf1eb3d5 to your computer and use it in GitHub Desktop.
Save stubailo/c010ba4d947928da769e0f5acf1eb3d5 to your computer and use it in GitHub Desktop.
The implementation of the ApolloMockingProvider
const ApolloMockingProvider = (props) => {
const mocks = mergeResolvers(globalMocks, props.customResolvers);
addMockFunctionsToSchema({ schema, mocks });
const client = new ApolloClient({
link: new SchemaLink({ schema }),
cache: new InMemoryCache(),
});
return (
<ApolloProvider client={client}>
{props.children}
</ApolloProvider>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment