Created
November 26, 2018 17:11
-
-
Save stubailo/51dc130cf5e1e9e684a24a80b158540f to your computer and use it in GitHub Desktop.
How we use a mocking provider to mock data
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
import TodoList from './TodoList'; | |
// Specify some resolvers for this instance | |
const customResolvers = { | |
Query: () => ({ | |
todoItems: [ | |
{ completed: true }, | |
{ completed: false }, | |
] | |
}) | |
}; | |
// TodoList uses the following query: | |
// query { | |
// todoItems { | |
// text | |
// completed | |
// owner { name } | |
// } | |
// } | |
<ApolloMockingProvider customResolvers={customResolvers}> | |
<TodoList /> | |
</ApolloMockingProvider> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment