T
TanStack3y ago
absent-sapphire

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.
1 Reply
united-yellow
united-yellow3y ago
queryClient.removeQueries

Did you find this page helpful?