Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TODO:
For reference, the mockServer function signature: https://github.com/apollographql/graphql-tools/blob/b85137ba81c9bdc5667bced9cad9b1d226ea83fc/src/mock.ts#L34-L38
I recently set up graphql mocking for the test environment in one of our apps, and it took me way longer than I care to admit to figure out that the single doc describing how to use
mockServer
was incorrect (should have looked at the source code a lot earlier in retrospect). This change fixes the example and adds a little more info to help prevent people from going down the wrong path.All that being said, in the future I think I would prefer to see the
mockServer
function take an object of named parameters like many of the other related functions (notablymakeExecutableSchema
andaddMockFunctionsToSchema
which are described in the same doc and take confusingly similar arguments). So, I wouldn't be upset if this PR turned into that.Thanks for all the hard work.