GraphQL Mutations
Explore how to perform GraphQL mutations by starring a GitHub repository using the GitHub API. Understand mutation structure, required variables, and how live data updates reflect in results. This lesson guides you through creating your first mutation to modify real GitHub data securely and effectively.
We'll cover the following...
Mutation vs. Query
GraphQL mutations complement GraphQL queries because they are used for writing data that queries can read. The mutation shares the same principles as the query: it has fields and objects, arguments and variables, fragments and operation names, as well as directives and nested objects for the returned result. When the mutation is valid, we should receive the updated data for the specified fields and objects in our query. Before we start making our first mutation, we need to be aware that we are using live GitHub data, ...