Multiple Mutation
Understand how to execute multiple mutations within a single GraphQL request. This lesson covers declaring mutations with aliases, passing variables, and managing their sequential execution to avoid race conditions, helping you effectively update server-side data using Apollo Server and Node.js.
We'll cover the following...
We now know how to modify server-side data and fetch multiple data requests on single queries. But what if we want to change the data on a single request?
Multiple mutations as a single request
On the field level, the mutation is just like a query. However, there’s an essential distinction between queries and mutations. While queries are parallel, mutations runs in a series, one after the other.
Suppose we send two CreatePizza mutations in one request. The first mutation will finish before the second begins, ensuring that ...