With pagination, decide which values from an array that you want to query. Sending arguments like first, last, or states can yield paginated result sets.
- [Instructor] In previous videos, we've used first…and last as arguments to specify which values…from an array we want to query.…In addition to first and last,…there are numerous other ways to paginate results.…Think of this like filtering,…and where do these filters come from?…They come from the API, and they're defined in the schema.…So here, we're going to query the repository field.…We're going to look at this graph QL project again,…and this owner, of course, is Facebook.…
Inside of our repository query,…we want to look for ID as well as issues,…so when I hit play, we'll see edges, node, and ID populate,…and here, we're going to look…for the number as well as the title.…Cool, so it's looking for the first or last value,…so we're going to define that here on line seven,…so we will say last five,…and that'll give us the last five issues, as we expect.…But there are also some optional arguments…we can use here as well.…
So as soon as I type S, we're going to see states,…and this is going to give us a list…of states that we can filter by.…
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