-
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
Refetch should not return partial data with errorPolicy none #10321
Refetch should not return partial data with errorPolicy none #10321
Conversation
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 a great start! I included a couple suggestions for you to take a look at. Thanks for working to fix this!
🦋 Changeset detectedLatest commit: 7c16b85 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 |
bf37255
to
7439e61
Compare
…none' of github.com:apollographql/apollo-client into issue-10317-refetch-gets-partial-data-with-errorPolicy-none
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.
Nice work! I had 2 minor asks, but this fix looks great! Thanks for looking into this!
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.
🚢 🚢 🚢
Closes #10317.
git bisect
identified 2d5e498 as the commit that introduced the regression.errorPolicy
:'none'
A quick recap of the default
errorPolicy
:In the linked issue, two sibling components make two separate queries, where one query's selection set is included in the second query's. The bug is seen when one query fails with an error, but on
refetch()
, the partial data in the cache is incorrectly rendered.Since the previous behavior was to indiscriminately unset
result.data
if thediff.complete || this.options.returnPartialData
check failed, this PR reinstates this behavior, but only whenerrorPolicy
isnone
andnetworkStatus
isrefetching
.Checklist: