You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use useQuery to fetch the data depending on some variables.
I trigger the query with a set of variables, the data is being stored in the cache. Then, I trigger the same query with different variables, but the query takes a long time. While the second call is still pending in the network, I trigger the query with the initial variables => I will instantly have the data from the cache. Once the pending query is resolved, the useQuery will return the new data, even if it doesn't correspond to the actual variables anymore, resulting in inconsistent data displayed on the dashboard.
I've opened #11186 which fixes the issue. If you want to try a snapshot release and make sure it works in your app as expected, you can install it via:
npm i @apollo/client@0.0.0-pr-11186-20230831064231
I've tried this snapshot release in your reproduction with success.
We should be able to get this fix in the next patch release or two (depending on when the PR is merged). Thanks for reporting the bug!
Hi @jerelmiller ! :)
I tried the fix in our project and it works! I will follow the PR to see when it's merged.
Thanks a lot for the fast and great work!
Feel free to close the issue from my side :)
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.
For general questions, we recommend using StackOverflow or our discord server.
Issue Description
I use useQuery to fetch the data depending on some variables.
I trigger the query with a set of variables, the data is being stored in the cache. Then, I trigger the same query with different variables, but the query takes a long time. While the second call is still pending in the network, I trigger the query with the initial variables => I will instantly have the data from the cache. Once the pending query is resolved, the useQuery will return the new data, even if it doesn't correspond to the actual variables anymore, resulting in inconsistent data displayed on the dashboard.
apollo/client version: 3.8.0
More details in the thread : https://discord.com/channels/1022972389463687228/1143184015877214228
@jerelmiller as discussed, I am tagging you here
Link to Reproduction
https://github.com/adianabob/apollo-client-demo
Reproduction Steps
apollo-client.mov
The text was updated successfully, but these errors were encountered: