-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
nextFetchPolicy function is not called sometimes #11365
nextFetchPolicy function is not called sometimes #11365
Comments
Hi @bignimbus, thanks for your reply. I have updated reproduction to use |
Any update on this? |
Hi Patel, apollo-client/src/core/ObservableQuery.ts Lines 882 to 884 in 3f7eecb
I'll change this to a bug with a reproduction, but right now I can't give you a timeframe on a fix here, as we are in the middle of finalizing Apollo Client 3.9 right now. |
Hi, any updates on this? If you are busy on upcoming release, then can I raise PR for it? |
I'll try to take a stab at this next week :) |
…etchPolicy` specified. fixes #11365
Sure. I will have look. Thank you for the update |
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Issue Description
I am using latest version of apollo client v3.8.7.
I am providing default
nextFetchPolicy
function to update fetchPolicy, if query hasfetchPolicy
ofcache-and-network
. According to the docs,nextFetchPolicy
function should be called after request is done(reasonafter-fetch
) and when variables are changed (reasonvariables-changed
).However,
nextFetchPolicy
function is not called after variables are changed(with reasonvariables-changed
). It is only called when request is done.Here is the code snippet that I am using,
Issue is solved if I comment out code inside
after-fetch
condition, but it limits usability of nextFetchPolicy function.Link to Reproduction
https://codesandbox.io/p/sandbox/eloquent-cori-2jngr7?file=%2Fsrc%2Findex.jsx
Reproduction Steps
Change values from dropdown and check logs in console.
Comment out code inside
after-fetch
condition in nextFetchPolicy function and check logs again.Current outcome:
variables-changed
).Intended outcome:
after-fetch
.The text was updated successfully, but these errors were encountered: