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
What's the current best practice on updating the cache yourself after a mutation vs invalidating queries? Is it just a trade off between complexity/diverging state (manual update) and extra network calls (refetch or invalidate)? I know a lot depends on how real time your application needs to be, is that the main consideration? Manually updating the cache being more prone to diverging states from the backend and therefore will be less "real time".
This is sort of addressed in this comment but in general was wondering if there are other unintended consequences that could happen with mutating state yourself on non-PUT/PATCH calls? I know the cache is meant to be immutable for the most part but I don't know if there are other bugs I'm unaware of that could spring up with manual updates?
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
-
What's the current best practice on updating the cache yourself after a mutation vs invalidating queries? Is it just a trade off between complexity/diverging state (manual update) and extra network calls (refetch or invalidate)? I know a lot depends on how real time your application needs to be, is that the main consideration? Manually updating the cache being more prone to diverging states from the backend and therefore will be less "real time".
This is sort of addressed in this comment but in general was wondering if there are other unintended consequences that could happen with mutating state yourself on non-PUT/PATCH calls? I know the cache is meant to be immutable for the most part but I don't know if there are other bugs I'm unaware of that could spring up with manual updates?
Beta Was this translation helpful? Give feedback.
All reactions