Skip to content

Commit

Permalink
add CREATE_TODO_ITEM mutation in NewTodoForm component
Browse files Browse the repository at this point in the history
  • Loading branch information
kamranhossain committed Jun 29, 2020
1 parent 1a79e97 commit 0e48073
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions assets/js/TodoApp/NewTodoForm.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
import React, { useState } from "react";
import PlusIcon from "./PlusIcon";
import React, { useState, FormEvent } from "react";
import { gql } from "apollo-boost";
import { useMutation } from "@apollo/react-hooks";

const CREATE_TODO_ITEM = gql`
mutation createTodoItem($content: String!) {
createTodoItem(content: $content) {
id
content
isCompleted
}
}
`;

interface Props {}

Expand Down

0 comments on commit 0e48073

Please sign in to comment.