Single Mutation

Understand insert, delete, and update operations on GraphQL.

So far, we’ve learned how to fetch data from servers using GraphQL. But in the production environment, we also need a way to apply the change to server-side data.

GraphQL mutation

In GraphQL, not every request has side effects on the server. Technically, any query could implement a function to modify server data. However, this is considered bad practice. Any operation that causes write should be sent explicitly via mutation operation type.

Similar to queries, the mutation field returns an object type. Let’s look at the mutation that’s available on our GraphQL server.

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy