is a promise returned from onError callback on a mutation awaited?
Hey all, just a quick question. I know when we do for example an onsuccess and return a promise to invalidate a given query i will be awaited.
Does this also count for the onError callback?
I need to do some logic whenever a mutation failes, and after that retry the mutation.
For example.
- add to cart
- onError -> check if cart exists/create cart
- rertry add to cart
4 Replies
like-gold•2y ago
onError
on useMutation
- yes
onError
on mutae
- noconscious-sapphireOP•2y ago
Oke thanks, seems like it was in the docs read over it.
do you know if its possible to re-call the mutation in the onError callback?
is the
retry
callback fired after the onError
, or is the onError
not called untill the failureCount
is met?like-gold•2y ago
the latter
conscious-sapphireOP•2y ago
thanks1