Replies: 1 comment 2 replies
-
What you want is to handle the promise inside the mutationFn and your stuff there |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there 👋
I have a hook that performs a mutation but it requires an API token to make a request. This mutation is called quite often and I was trying to avoid calling the API token endpoint every time unless it fails as the user has deleted the API key for example. The problem is that I'm trying to handle this logic on the
onError
handler of the mutation but looks like it's bubbling the error and I want to keep this logic in the hook.I am using react-query v4.
Is this possible?
Beta Was this translation helpful? Give feedback.
All reactions