Skip to content
Discussion options

You must be logged in to vote

I don't see how its currently possible, because react-query needs a resolved or rejected promise to go into success or error state. You could do it in user-land by:

  • returning a resolved promise
  • inspect data and move the related errors to a separate error field that you can then return from your custom hook.

but react-query will not go into error state then, so there won't be retries for example.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rajansolanki
Comment options

Answer selected by rajansolanki
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants