Dgraph GraphQL Tour

Basic

Pagination (first and offset)

It’s not uncommon to have thousands of results for a query.

But you might want to paginate the results for display, or limit a large result set.

Dgraph generates first and offset arguments that can be used in combination to achieve such limits and paginate results:

  • first: N Return only the first N results
  • offset: N Skip the first N results

By default, query answers are ordered by uid. You can change this behavior by explicitly specifying an order.

The first and offset arguments are available on query<Type> queries and on any edge to a list of nodes.

2.8 Pagination (first and offset)