Created
November 26, 2018 17:12
-
-
Save stubailo/c010ba4d947928da769e0f5acf1eb3d5 to your computer and use it in GitHub Desktop.
The implementation of the ApolloMockingProvider
This file contains 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
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