-
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
Fields without @client
directive should not be resolved locally
#9573
Conversation
@vladar: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/ |
🦋 Changeset detectedLatest commit: 03f30f2 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 |
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.
Hey @vladar 👋 !
Thanks so much for your patience. I really like the work you've done here and think this will be a tremendous improvement to the client. I've left only minor bits of feedback for you, but overall really like the strategy you took here. Glad its also been confirmed that this solution works for others. I'd like to get this merged as soon as you're able to address some of the feedback. Thanks again for the contribution!
… to differentiate between it and `ExecContext`.
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.
@vladar thanks so much again for the contribution! Looking forward to getting this released 🎉 🎉
Description
This PR fixes an incorrect behavior when local resolvers are executed even for fields without a
@client
directive. Reproduction is in the PR tests. This happens because Apollo walks through every single selectionSet in LocalState without checking if this selectionSet actually has a@client
directive.This problem also affects query performance significantly in some cases, see the benchmark.
For server GraphQL results like this:
The benchmark shows the following numbers:
Fixes #9571