Search⌘ K
AI Features

Exercise: Implement a Mutation

Explore how to implement a GraphQL mutation to add new categories by defining schema types and creating resolver functions. This lesson helps you set up mutation definitions, write resolvers using Category.create, and test your backend mutation functionality.

Exercise source code

To get the source code for this exercise, run the following command in the project’s repository:

git checkout categories-mutation-exercise

How to start the project

To start the project, follow the same steps from the previous lesson.

Add a new mutation definition

First, we need to add a definition to a new ...