Package org.apache.sling.graphql.helpers
Class GenericConnection<T>
java.lang.Object
org.apache.sling.graphql.helpers.GenericConnection<T>
- All Implemented Interfaces:
Connection<T>,PageInfo
@ConsumerType
public final class GenericConnection<T>
extends Object
implements Connection<T>, PageInfo
As per https://relay.dev/graphql/connections.htm a "connection"
is a page of results for a paginated query.
Use the
GenericConnection.Builder class to build a Connection that outputs
the supplied data, optionally sliced based on a "start after" cursor
and a limit on the number of items output.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intWe might make this configurable but for now let's stay on the safe side -
Method Summary
-
Field Details
-
DEFAULT_LIMIT
public static final int DEFAULT_LIMIT- See Also:
-
MAX_LIMIT
public static final int MAX_LIMITWe might make this configurable but for now let's stay on the safe side- See Also:
-
-
Method Details
-
getEdges
- Specified by:
getEdgesin interfaceConnection<T>
-
getPageInfo
- Specified by:
getPageInfoin interfaceConnection<T>
-
getStartCursor
- Specified by:
getStartCursorin interfacePageInfo
-
getEndCursor
- Specified by:
getEndCursorin interfacePageInfo
-
isHasPreviousPage
public boolean isHasPreviousPage()- Specified by:
isHasPreviousPagein interfacePageInfo
-
isHasNextPage
public boolean isHasNextPage()- Specified by:
isHasNextPagein interfacePageInfo
-