From the course: Building a GraphQL Project with React.js

Unlock this course with a free trial

Join today to access over 22,500 courses taught by industry experts.

Setting up pagination

Setting up pagination

- [Instructor] The last feature that we're going to add to this application is pagination. Now to do that, we need to review how it works in the GitHub GraphQL Explorer. So the way that you do this is by adding a series of edges and then putting the nodes within those edges. So we're going to have to modify our queries. And to do that, I'll kind of show you what you need to do in this GraphQL Explorer. We're going to need to track a set of edges, and inside those edges, we are going to track a cursor. A cursor is like an ID that identifies each one of the nodes and gives it an ID that you can use for pagination. So you can say, "Give me the first 10 items," or you can say, "Give me the first 10 items "after a specific cursor." So we are going to take these nodes and then put them inside after the cursor. Go ahead and put them in here. And inside the edges, they're not called nodes 'cause there's only one node per edge, so…

Contents