Apollo Client and a GraphQL Mutation
This lesson will brief about how to go about GraphQL Mutation using Apollo Client.
We'll cover the following
Previously, you learned how to query data from GitHub’s GraphQL API using the Apollo Client. Once the client is set up with a configuration, you can use its query()
method to send a GraphQL query
with optional variables
. As you have learned, reading data with GraphQL is not everything, because there are mutations for writing data as well.
In this lesson, you are going to define a mutation to star a repository on GitHub. The Apollo Client instance sends the mutation, but at first, you have to define it.
Get hands-on with 1400+ tech skills courses.