Root Mutation Type

Learn root mutation types and how we add mutation fields in GraphQL.

Defining a root mutation type

We need to define a root mutation type to support mutation operations, just as we did for queries. This will be used as the entry point for GraphQL mutation operations. The mutation fields that we add define the complete list of capabilities available to the API users to modify data. We define the root mutation type by using the mutation macro in our schema file, as shown here:

Get hands-on with 1200+ tech skills courses.