Currently, I have a react component which needs to call 2 mutations from the same component on different buttons clicks.
I am using react-apollo
to interact with graphql server from react component.
If I use this.props.mutate
to call the mutation on click event, there is no option/argument to specify which mutation I want to call.
https://www.apollographql.com/docs/react/essentials/mutations.html
If I directly use this.props.mutate({variables: {...}})
it always calls the first mutation imported to the file.
Mutation
component? If so, you can wrap more than one components with different mutations. – Ionut Achim