aws-mobile-appsync-sdk-js
aws-mobile-appsync-sdk-js copied to clipboard
Instead of graphqlMutation, what package need to used from apollo/client.
Instead of graphqlMutation, what package need to used from apollo/client. I dont want to add "aws-appsync-react".
Make sure you have "aws-amplify" installed and configured.
Do import { gql, useMutation } from "@apollo/client" and then establish const [makeToDo] = useMutation(gql(createToDo))
makeToDo() is the function that executes the mutation so you can execute the following example as the first argument is the input for the mutation makeToDo({ variables: { input: { task: "ToDo" } } })
https://www.apollographql.com/docs/react/data/mutations/