TypeError: (destructured parameter).post is undefined
import React from "react";
import { Button, Form } from "semantic-ui-react";
import gql from "graphql-tag";
import { useForm } from "../util/hooks";
import { useMutation } from "@apollo/react-hooks";
This tutorial was put up on https://www.youtube.com/watch?v=n1mdAPFq2Os only 3 weeks ago but a lot of the code is broken.
I'm getting the following error
function PostForm() { const { values, onChange, onSubmit } = useForm(createPostCallback, { body: "", });
const [createPost, { error }] = useMutation(CREATE_POSTMUTATION, { variables: values, update(, result) { console.log(result); values.body = ""; }, }); function createPostCallback() { createPost(); } return (
); }
const CREATE_POST_MUTATION = gql
mutation createPost($body: String!) { createPost(body: $body) { id body createdAt username likes { id username createdAt } likeCount comments { id body username createdAt } commentCount } }
; export default PostForm;