Edit data with the GitHub API by sending mutations with new data sets. This video shows how to add a comment to an issue using the addComment mutation.
- [Instructor] The GitHub GraphQL API has a ton…of different mutations that we can take advantage of.…If I check out the Docs panel,…and I click on Mutation, this will give you a list…of all of the different mutations that you can use.…The one that we're going to be most interested in here…is called addComment.…If I click on addComment, you're going to see…that it takes in a payload called AddCommentPayload.…And then we're going to notice…that it takes in the argument of input.…
So over here in my GitHub account,…we have a repository called graph-ql-testing.…And underneath this, we have an issue created,…and it's called Creating Mutations.…Now the change that I want to make in this lesson…is to add a new comment to this issue.…I'm going to do this for this particular project,…and you can do this for this same project,…or you can make a comment on one of your own.…Now in order to add a comment,…I need to figure out what the ID of this repository is.…
And I can do this, of course, by writing a query.…So I'm going to minimize our Docs panel,…
In this course, learn how to get started with GraphQL. Eve Porcello walks through the basics of this query language, diving into the data fetching specification, and helping you get up to speed with the syntax and vocabulary of GraphQL. Eve explains how to create basic queries, including how to work with arguments and multiple fields. She also goes into complex techniques for handling data, including working with aliases, fragments, and pagination. Plus, she covers how to edit and transform data with mutations.
- Learning about the origins of GraphQL
- Learning about how GraphQL makes data fetching and updating easier
- Creating basic queries
- Using multiple fields
- Understanding schemas
- Handling data
- Drilling down into nested fields with a query
- Adding variables for argument values
- Creating mutations
- Adding a reaction mutation