mutation is returning void
I made a procedure that returns a string, but when I try to use it on my frontend, it's returning void instead of a string.


20 Replies
the images below are the procedure


When using
mutate
, you are expected to use the onSuccess
and onError
callbacks you can provide as a second argument. It won't wait for you to finish. The behaviour you want can be done with mutateAsync
, which you'll have to await
.anychance this is the same as you are talking about?

I know this is for optimistic ui updates, but can I add onSuccess to that?
Yeah that's it
it still does the same thing when I do this
You can do it either in
useMutation
or when you call mutate
I still get the same issue even when I use this 😦
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Show how you're using
onSuccess
sorry I'm a little novice to this
working on adding this right now

my brain is not working anymore
lmfao
put all the stuff from the onSubmit into that function
except for the initial mutation

like this stuff?
yeah
mutate
doesn't return anything, you handle all the success/error logic in those callbacks