TanStackT
TanStack3y ago
1 reply
then-purple

Is it possible to automatically invalidate suspense query before fetching?

I have a form with auto-save. If I leave after making changes and navigate back, I receive the stale data first despite the query being stale and then fresh data. I would like to receive only the updated data and have the regular suspense behavior. I populate the state from the query data initially and do not want to synchronize it with query responses. I could invalidate it myself which is tedious and if the changes would happen outside of the client there would be no way to invalidate the query at all.
Was this page helpful?