ElasticGraph Query API: Pagination
To provide pagination, ElasticGraph implements the Relay GraphQL Cursor Connections Specification. Here’s an example query showing pagination in action:
In addition, ElasticGraph offers some additional features beyond the Relay spec.
Total Edge Count
As an extension to the Relay spec, ElasticGraph offers a totalEdgeCount
field alongside edges
and pageInfo
.
It can be used to get a total count of matching records:
Note: totalEdgeCount
is not available under an aggregations field.
Nodes
As an alternative to edges.node
, ElasticGraph offers nodes
. This is recommended over edges
except when you need
a per-node cursor
(which is available under edges
) since it removes an extra layer of nesting, providing a simpler
response structure: