toRelayConnection
function toRelayConnection<T>(result, cursorFor?): RelayConnection<T>;Defined in: pagination-output.ts:25
Shape a Paginated<T> result as a Relay connection. Pass the paginator’s
cursorFor so every edge gets its own cursor; without it only
pageInfo.startCursor/endCursor are populated.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
result |
Paginated<T> |
cursorFor? |
(item, index) => string |
Returns
Section titled “Returns”Example
Section titled “Example”const result = await paginator.paginate(fromRelayArgs(args));return toRelayConnection(result, paginator.cursorFor);