-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Schema-driven testing utilities #11605
Schema-driven testing utilities #11605
Conversation
🦋 Changeset detectedLatest commit: 614cd3f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
size-limit report 📦
|
✅ Deploy Preview for apollo-client-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
…e into separate folder
f594629
to
e92a0af
Compare
/release:pr |
A new release has been made for this PR. You can install it with:
|
…omment about why we call .bind
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is neat! I had one comment as something to think about, but otherwise I've got nothing else other than any feedback from Lenz. Really excited for this feature 🎉 🔥
…failing HttpLink test
…pollographql/apollo-client into issue-9738-schema-driven-testing-utils
Introduces a new testing utility currently in
src/testing/core/schemaProxy.ts
(name subject to change) which creates a Proxy object to a user-supplied schema, allowing users to set (and override) mock resolvers inline in their tests.In combination with a terminating
SchemaLink
or MSW, this new API will allow users to write tests that more closely resemble how users actually use their applications, testing link chain code not previously possible with theMockedProvider
approach of static response mocking and providing a way to define default scalar mocks.This is a draft that makes use of utilities from @graphql-tools/mock which have been inlined with line references to the original MIT-licensed code, and with the license copied over alongside.