-
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
<Query fetchPolicy="cache-and-network" onCompleted={...}> doesn't fire #4921
Comments
@sfcgeorge Can you provide a small runnable reproduction that shows this issue? I'm not seeing the problem on my end. |
When using latest i get an TS error, it says:
I found the types here, somehow cache-and-network got lost and seems to be part of the watchQuery only?
It seems to be done in this commit cf069bc#diff-88b34d7add139a9c0e7d4c2b1944a8dc Related to PR #3130 personally i read the DOCS sometimes but it seems to be outdated even the comments in the code itself. For the TS, we are using the onCompleted callback and that still works. |
@maapteh There is no mistake with the code. The commit you are referencing contains a link to this issue thread explaining why the changes were made. In short, the |
Please try a recent version of |
Intended outcome:
onCompleted callback should be run when a query completes.
Actual outcome:
The callback doesn't fire when using
fetchPolicy="cache-and-network"
.How to reproduce the issue:
^ Removing the fetch policy it fires correctly.
Versions
The text was updated successfully, but these errors were encountered: