Help Needed to Prevent Data Loss When Page is Refreshed Using React-Query #7046
Unanswered
adilvalizada
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We currently have an issue in our system's mutation flow. Essentially, when we perform a mutation (create/update/delete) locally, it updates the cache and we see the result correctly. However, upon refreshing the page, the server resends the data to the browser, and the server cache is not updated for some reason.
Currently, we are resolving this issue by setting the 'stale time' to 5 seconds, but this solution is not ideal as it causes unnecessary refetches.
In our current solution, I have added invalidate queries to all generic mutation calls to attempt to solve this issue, but this solution feels like a temporary fix.
How can we solve our problem? We await your assistance. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions