For now, that module only supports cursor-based "infinite scroll" style pagination, where you can only move forward in the result set.
It would be nice to support this in the client, with an API that makes the result set appear continuous, while making additional queries as needed to acquire the data. A callback on each such query comes to mind as a way to allow the client to keep track of progress and optionally stop before the end of the result set if desired.
The Apache Sling GraphQL Core module, which provides GraphQL support for AEM, now supports paginated result sets following the Relay Connections spec, see https://github.com/apache/sling-org-apache-sling-graphql-core/#result-set-pagination-using-the-connection-and-fetcher-directives . The
oneSchemaQuery
example there shows a typical response.For now, that module only supports cursor-based "infinite scroll" style pagination, where you can only move forward in the result set.
It would be nice to support this in the client, with an API that makes the result set appear continuous, while making additional queries as needed to acquire the data. A callback on each such query comes to mind as a way to allow the client to keep track of progress and optionally stop before the end of the result set if desired.