Best practice for dealing with mutation function that doesn't error
Hey all,
I have a useMutation that wraps a function that returns a type like follows:
The difficulty is I want to use React-Query's features like status, auto-error retrying, etc. To make this work, I've had to wrap the mutation function in something that checks for status === "error" and then throw an error so React-Query sees it as such. Anyone have a cleaner idea for this?
I have a useMutation that wraps a function that returns a type like follows:
The difficulty is I want to use React-Query's features like status, auto-error retrying, etc. To make this work, I've had to wrap the mutation function in something that checks for status === "error" and then throw an error so React-Query sees it as such. Anyone have a cleaner idea for this?