-
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
Fix a timing problem where useQuery
would execute an outdated callback reference.
#12319
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 134e5c3 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 |
✅ Docs preview readyThe preview is ready to be viewed. View the preview File Changes 0 new, 1 changed, 0 removed
Build ID: b50330828fc68f6022ef305c URL: https://www.apollographql.com/docs/deploy-preview/b50330828fc68f6022ef305c |
commit: |
size-limit report 📦
|
✅ Deploy Preview for apollo-client-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
useQuery
would execute an outdated callback reference.
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.
Approved assuming this fixes the reported issue
Given that we will be deprecating |
@jerelmiller It might at least make the bug trigger a bit less, and it doesn't add a lot of bundle size, so I'd suggest we still ship this - it just doesn't hurt. |
This changes the timing to save the callbacks to the ref ever so slightly sooner.
By my testing in the user-supplied reproduction, this fixes #12316 where a cache hit would have triggered
setResult
before the callback ref could have been updated.