-
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: avoid redundant refetchQueries call for mutation with no-cache policy #11515
Conversation
|
Name | Link |
---|---|
🔨 Latest commit | 35e9f36 |
🦋 Changeset detectedLatest commit: 35e9f36 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.
Hi, this is a very good catch, thank you for that!
I've made some suggestions that would keep the change in bundle size down a bit - what do you think?
Co-authored-by: Lenz Weber-Tronic <[email protected]>
Co-authored-by: Lenz Weber-Tronic <[email protected]>
Updated, thanks. But looks like it doesn't help with |
Don't worry about the size check - I'll fix that up before merging :) This looks good to me. We're currently in a code freeze, so this will probably be released in a 3.9.1 after we've released our 3.9 minor. |
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.
🎉 Now with 3.9 out, we'll get this into 3.9.1 🙂
This is a quick small fix for the bug outlined in #10238
In the nutshell,
mutation.refetchQueries
below is an empty array, not boolean or undefined. So this check errorneously evaluates to true even when therefetchQueries
option is not set for the mutation.The fix in this PR is a bit defensive - in case if it could be actually something other than array.
apollo-client/src/core/QueryManager.ts
Lines 400 to 406 in 31fc8df
Fixes #10238