Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mockServer example #1012

Merged
merged 2 commits into from Nov 30, 2018
Merged

Fix mockServer example #1012

merged 2 commits into from Nov 30, 2018

Conversation

dougshamoo
Copy link
Contributor

@dougshamoo dougshamoo commented Nov 29, 2018

TODO:

  • If this PR is a new feature, reference an issue where a consensus about the design was reached (not necessary for small changes)
  • Make sure all of the significant new logic is covered by tests
  • Rebase your changes on master so that they can be merged easily
  • Make sure all tests and linter rules pass
  • Update CHANGELOG.md with your change. Include a description of your change, link to PR (always) and issue (if applicable). Add your CHANGELOG entry under vNEXT. Do not create a new version number for your change yourself.

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 (notably makeExecutableSchema and addMockFunctionsToSchema 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.

@apollo-cla
Copy link

@dougshamoo: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/

@mfix22 mfix22 added the docs Focuses on documentation changes label Nov 30, 2018
@mfix22 mfix22 merged commit d64f175 into ardatan:master Nov 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Focuses on documentation changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants