T
TanStack3y ago
typical-coral

Can I reset all mutation state similar to how I can clear all queries based on key?

I display error or success messages when certain mutations complete. When I switch users, I clear all queries under the user key, but this doesn't reset the mutations I have keyed the same way. Then, the current user sees the mutation state of the previous user.
3 Replies
exotic-emerald
exotic-emerald3y ago
I am also very interested in how one can reset all mutation data. Strange that there does not seem to be an API for this.
eastern-cyan
eastern-cyan3y ago
How about hard reloading the site and thus creating a new queryClient?
grumpy-cyan
grumpy-cyan3y ago
call reset that return from useMutation

Did you find this page helpful?