diff --git a/web/src/pages/ContactPage/ContactPage.tsx b/web/src/pages/ContactPage/ContactPage.tsx index 21a29955c..ed4d3e7e4 100644 --- a/web/src/pages/ContactPage/ContactPage.tsx +++ b/web/src/pages/ContactPage/ContactPage.tsx @@ -15,7 +15,7 @@ import { MetaTags, useMutation } from '@redwoodjs/web' import { toast, Toaster } from '@redwoodjs/web/toast' const CREATE_CONTACT = gql` - mutation CreateContact($input: CreateContactInput!) { + mutation CreateContactMutation($input: CreateContactInput!) { createContact(input: $input) { id } @@ -31,7 +31,7 @@ interface FormValues { const ContactPage = () => { const formMethods = useForm({ mode: 'onBlur' }) - const [createContact, { loading, error }] = useMutation< + const [create, { loading, error }] = useMutation< CreateContact, CreateContactVariables >(CREATE_CONTACT, { @@ -41,8 +41,8 @@ const ContactPage = () => { }, }) - const handleSubmit: SubmitHandler = (data) => { - createContact({ variables: { input: data } }) + const onSubmit: SubmitHandler = (data) => { + create({ variables: { input: data } }) } return ( @@ -50,7 +50,7 @@ const ContactPage = () => { -
+