New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Useing ApolloClient.useMutation() #51
Comments
It's number 2: "you might be breaking the rules of hooks". In the error it says "Hooks can only be called inside of the body of a function component", but here you're using a hook in the body of a plain function. |
And to answer how the two things are different, one is a hook and one is a method on the client (both do essentially the same thing). The hook has other args you can pass to it like |
Also, please note you are not actually executing your mutation in your hook example. Please check out the apollo docs on how to use |
Thank you for taking the time to educate me, brother. Peace to you. |
I am trying to use
onCompleted
onuseMutation
. Maybe this is equivalent to some other method in the library?This compiles but doesnt not look right and cause an
invalid hook call
error.error:
Being called like this since its the only way i can get it to compile:
Thank you in advance!
Super work here!
Also, how is the above function different from the following which works but doesnt have
onCompleted
as an option?The text was updated successfully, but these errors were encountered: