#is a promise returned from onError callback on a mutation awaited?

4 messages · Page 1 of 1 (latest)

vestal quiver
#

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
pearl glade
#

onError on useMutation - yes
onError on mutae - no

vestal quiver
#

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?

pearl glade
#

the latter