You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2021/05/12 10:37:39 UTC

[sling-org-apache-sling-graphql-core] 02/02: SLING-10309 - update README

This is an automated email from the ASF dual-hosted git repository.

bdelacretaz pushed a commit to branch SLING-10309/experiment
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-graphql-core.git

commit 672eb71fa8877d76808f9188d00d4a991498871c
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Wed May 12 12:37:23 2021 +0200

    SLING-10309 - update README
---
 README.md | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/README.md b/README.md
index 07ea4fc..a5b0e50 100644
--- a/README.md
+++ b/README.md
@@ -151,6 +151,16 @@ which have Java package names that start with `org.apache.sling`.
 The `<options>` and `<source>` arguments of the directive can be used by the
 `SlingTypeResolver` services to influence their behavior.
 
+## Result Set Pagination
+
+The [GenericConnection](./src/main/java/org/apache/sling/graphql/core/helpers/pagination/GenericConnection.java) class provides support
+for paginated results, following the [Relay Cursor Connections](https://relay.dev/graphql/connections.htm) specification.
+
+With this utility class, you just need to supply an `Iterator` on your data, a function to generate a string that represents the cursor
+for a given object, and optional parameters to control the page start and length.
+
+The [GenericConnectionTest](./src/test/java/org/apache/sling/graphql/core/pagination/GenericConnectionTest.java) class has concrete examples of that.
+
 ## Caching: Persisted queries API
 
 No matter how you decide to create your Sling GraphQL endpoints, you have the option to allow GraphQL clients to use persisted queries.