Created
July 20, 2020 18:48
-
-
Save acomito/61ec2f948ad7151ebef0495c1d39144b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import MY_MUTATION from 'ApolloClient/Mutations/myMutation.js' | |
import { useMutation } from 'react-apollo' | |
const MyFunctionComponent = () => { | |
const [myMutation] = useMutation(MY_MUTATION); | |
const handleOnClick = async () => { | |
await myMutation({}) | |
} | |
return <button onClick={handleOnClick}>Click Me</Button> | |
} | |
export default MyFunctionComponent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment