fromRelayArgs
function fromRelayArgs(args, options?): CursorPagination;Defined in: pagination-params.ts:130
Convert Relay connection args into a CursorPagination input:
last/before paginate backward, first/after paginate forward.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
args |
RelayArgs |
options? |
Pick<ParsePaginationParamsOptions, "defaultPageSize" | "maxPageSize"> |
Returns
Section titled “Returns”Example
Section titled “Example”fromRelayArgs({ first: 10, after: "abc" });// { type: "cursor", limit: 10, cursor: "abc", direction: "forward" }fromRelayArgs({ last: 5, before: "xyz" });// { type: "cursor", limit: 5, cursor: "xyz", direction: "backward" }