Is there a way to call mutate directly? #1222
Unanswered
ryantomaselli
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Hmm, why can’t you call the same mutation function twice? Say you have two button, each with a click handler that fires off the mutation. If you need to track different loading states, I would call |
Beta Was this translation helpful? Give feedback.
3 replies
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.
-
Hey guys;
I would like to call mutate function returned by the useMutation hook multiple times. Of course this is a bad idea because each mutate function returned by useMutation has its own state (isLoading, isError etc.)
Does react-query expose something similar to apollo client's mutate function?
See https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.mutate
Cheers
Beta Was this translation helpful? Give feedback.
All reactions