Organization / Guides
Pagination
Page through long lists with cursors.
Forward pagination
Request first items and retain endCursor. On the next request, pass it asafter. Continue while hasNextPage is true.
query Orders($first: Int!, $after: String) {
orders(first: $first, after: $after) {
edges {
cursor
node { id reference }
}
pageInfo { hasNextPage endCursor }
}
}Connection arguments
firstNumber of items to fetch forwardafterReturn items after this cursorlastNumber of items to fetch backwardbeforeReturn items before this cursorSupply first or last; the maximum page size is 250. Cursors are opaque: pass them back as you received them.