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 firstN
resultsoffset: N
Skip the firstN
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.