Concluding Mutations

Implement a mutation query in a React application.

Summarizing mutations

When a createBook mutation is sent from our client, our GraphQL server will create a new book within its GraphQL server. Later on, when we search for books, we’ll be able to see our new book within that list.

Exercise: Creating a book with feedback and validation

Using what we have learned, let’s update the code widget below to enable creating books in the application. The application must give a prompt on successful book creation and throw an error for an empty field.

Get hands-on with 1400+ tech skills courses.