Make mutation fail with request error if called with 0 args #1771
Unanswered
bogdanailincaipnt
asked this question in
Ideas
Replies: 0 comments
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.
-
I've been trying to implement a use case where I need the call to
mutate()
to fail with the request error.I am aware that it's been discussed that
mutate
should maybe only throw errors related to the act of mutating.However, I think this can be handled differently based on what type of parameter we send to
mutate()
as the first parameter, and if we sendshouldRevalidate
as true/false.So what I'm suggesting is that whenever we do not send anything as a param to
mutate
(meaning thatshouldRevalidate
will betrue
, as it is by default, and that an API call will be made),mutate
should throw any eventual api error.Beta Was this translation helpful? Give feedback.
All reactions