How to abort a useMutation ?
Hello,
I have a use case where i have to do several mutations in a promise, but i want to cleanup the queries at unmount.
Now : i am using a signal with an abortController, is there a simpler solution ?
My mutation :
3 Replies
harsh-harlequin•2y ago
I saw Dominik talk about this somewhere. As far as I know there's no way to abort mutations because it's designed for server effects, so once it reaches the server the client can't stop it. You can cancel the request and ignore the response, which looks like what you're attempting, but that doesn't actually stop the effects it already started/made
harsh-harlequin•2y ago
GitHub
How to cancel/abort a mutation query? · TanStack query · Discussion...
Is there a way to cancel/abort mutation requests, similar to how cancelqueries does it for queries? I can't seem to figure that out.
metropolitan-bronzeOP•2y ago
@troywoy Thank you for the answer