How to get around mutate onSuccess only being called for the last mutation? #2614
-
I understand per the docs that for useMutation.mutate:
I have a custom hook were I have used useQueries to get my data and then manage updates to the queries. One of these is save all which runs the mutation for anything that is out of sync. I use the onSuccess callback to update the sync information and it is only getting called for the last one. Is there any way for me to calls these differently or track the mutations individually in order to fire off the callbacks myself? Do I need to dive into the mutation cache and watch for those updates somehow? Any help would be greatly appreciated, thanks. Dan |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hm, could be that this only applies to the callback on the |
Beta Was this translation helpful? Give feedback.
Hm, could be that this only applies to the callback on the
.mutate
function, not the one for theuseMutation
call itself. Otherwise, maybe usemutateAsync
to await the promise