useMutation is returning success on fetch error using Fetch API
Hey, I am trying to signup using a previously used credentials so, I am getting a network error
409 conflict but, useMutation is not returning an error!
It is returning success instead with the error data inside the body the following
Also, the event onError is not fired at all!
Any suggestion?1 Reply
noble-gold•3y ago
The Fetch API doesn't consider 4xx status codes erroneous. Please see: https://tanstack.com/query/v4/docs/react/guides/query-functions#usage-with-fetch-and-other-clients-that-do-not-throw-by-default