How to get response data on mutation error ? #1846
-
I have a sign in mutation, that returns a 422 response when the credentials are not correct, along with a data object that contains the error message for the keys.
Here is the part where the mutation is called.
When the mutation errors out due to incorrect credentials, the onError property of the mutation gets set to true. But the error property is undefined. I read on the documentation that there is no need for custom errors throws on Api Clients like axios. Why is the error property undefined and how can I set it up to get the error response send by the Server. For reference here is the server response
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Do you have a codesandbox? I’m pretty sure that works.
not sure what you mean. onError is a callback function like onSuccess 🤔 |
Beta Was this translation helpful? Give feedback.
Do you have a codesandbox? I’m pretty sure that works.
not sure what you mean. onError is a callback function like onSuccess 🤔