adobe / aem-headless-client-js

AEM Headless Client for JavaScript
Apache License 2.0
25 stars 12 forks source link

Support for paginated query results #25

Closed bdelacretaz closed 1 year ago

bdelacretaz commented 3 years ago

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.

bdelacretaz commented 3 years ago

https://github.com/adobe/aem-headless-client-java/issues/4 is the same feature request for the Java client.

easingthemes commented 1 year ago

PR merged and package v3.3.0 published to NPM