async function createLike() {
    if (!formData.name || !formData.description) return;
    await API.graphql({ query: createLikeMutation, variables: { input: formData } });
    setLikes([ ...likes, formData ]);
    setFormData(initialFormState);
  }
// mutation so that a new like can be created with the form data.
mutation so that a new like can be created with the form data.
mutation so that a new like can be created with the form data .
async function createLike() {
    if (!formData.name || !formData.description) return;
    await API.graphql({ query: createLikeMutation, variables: { input: formData } });
    setLikes([ ...likes, formData ]);
    setFormData(initialFormState);
  }
async function createLike ( ) { if ( ! formData . name || ! formData . description ) return ; await API . graphql ( { query : createLikeMutation , variables : { input : formData } } ) ; setLikes ( [ ... likes , formData ] ) ; setFormData ( initialFormState ) ; }
mutation so that a new like can be created with the form data.
mutation so that a new like can be created with the form data .