8 Implementing mutations

This chapter covers

  • Implementing GraphQL’s mutation fields
  • Authenticating users for mutation and query operations
  • Creating custom, user-friendly error messages
  • Using powerful database features to optimize mutations

We implemented most of the query tree for the AZdev GraphQL API in chapter 7. It’s now time to implement the mutation operations we planned, starting with the userCreate mutation to enable AZdev users to create an account and use other mutations (and queries) that require authenticated requests.

Since this is the very first mutation we’re creating, we need to do some groundwork to wire things up for all mutations. We basically need to make the schema ready to host mutations.

Current code

Use git checkout ...

Get GraphQL in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.