Skip to content

Commit

Permalink
update docs for mocking
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Helfer committed Apr 23, 2016
1 parent e3f57d6 commit f870d09
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docs/source/apollo-server/mocking.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ For more information about how to use the `mockServer` function, see the [Medium
</h3>

`addMocksToSchema` is the function that `mockServer` uses under the hood. Given an instance of GraphQLSchema and a mock object, it modifies the schema in place to return mock data for any valid query that is sent to the server. If `mocks` is not passed, the defaults will be used for each of the scalar types. If `preserveResolvers` is set to `true`, existing resolve functions will not be overwritten to provide mock data. This can be used to mock some parts of the server and not others.
`mockServer` will set the `context` to `{}` when invoking `graphql`, which means that the mock functions could use that context to store additional information for mocking, such as relationships between different types.

0 comments on commit f870d09

Please sign in to comment.