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
Hello.
I have a question about queryCache.invalidateQueries, specifically about requests it makes.
In this example (https://codesandbox.io/s/upbeat-star-dw0sr?file=/src/App.js) we can invalidate queries after we clicking the button.
But if we press button while posts loading, additional request won't happen.
Why is that important for me? Because we may have mutate function, which updating data on the server. And we want to invalidate queries with onSettled callback. But if onSettled callback will be called while requests already happening, it won't make additional request and we left with stale data. (https://codesandbox.io/s/kind-margulis-dr0ro?file=/pages/index.js)
Also, video, showing my problem (https://youtu.be/nX9GwAfBQxw).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello.
I have a question about queryCache.invalidateQueries, specifically about requests it makes.
In this example (https://codesandbox.io/s/upbeat-star-dw0sr?file=/src/App.js) we can invalidate queries after we clicking the button.
But if we press button while posts loading, additional request won't happen.
Why is that important for me? Because we may have mutate function, which updating data on the server. And we want to invalidate queries with onSettled callback. But if onSettled callback will be called while requests already happening, it won't make additional request and we left with stale data. (https://codesandbox.io/s/kind-margulis-dr0ro?file=/pages/index.js)
Also, video, showing my problem (https://youtu.be/nX9GwAfBQxw).
Beta Was this translation helpful? Give feedback.
All reactions