Create todos - mutation
In this part of the tutorial, you will learn how to create new todos by using GraphQL Mutations.
Let's define a graphql mutation to perform insert into todos.
mutation insert_todos($todo: String!, $isPublic: Boolean!) {insert_todos(objects: {title: $todo, is_public: $isPublic}) {affected_rowsreturning {idtitlecreated_atis_completed}}}
You will also need to pass in the values for the variables.
Try this mutation in GraphiQL against the application database to see what the response looks like.
Let's now integrate this graphql mutation into our react app.