Eve describes how to drill down into nested fields with a query. This demonstrates how GraphQL queries can return complex data structures with ease.
- [Instructor] So far, we've queried data…that is fairly flat.…For example, we've requested data from a certain viewer,…then the subfields show us different data types…like integers, strings, and Booleans.…That's pretty cool,…but there's a lot more power in GraphQL…that we've yet to explore.…Next, I want to see what this viewer's repositories are.…So on line 8, I'm going to add repositories,…and them I'm going to hit play.…Couple different things go on here,…a new field pops up on line 9 called edges,…and whenever we see edges,…this indicates that there's some sort of a connection…to another array of data.…
Here, we're looking for a list of repositories,…so from the edges field,…you're going to see another field called node.…Node is going to stand in…for all of the different repositories…in this viewer's list.…So we're going to add a couple different fields here.…We already have id,…and then let's also look for the name field.…I'll hit play again…and we'll see this error message still exist.…It says, you must provide a 'first' or 'last' value…
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