Type alias CollectionParams

CollectionParams: {
    __pg?: {
        size?: number;
        cursor?: string | null;
    };
    __sort?: string;
}

Parameters that can be passed to endpoints retrieving collections

Note: These two keys use the double-underscore (__) prefix because without such prefix they may be indistinguishable from a constraint using arbitrary, user-defined fields. This was a problem when developing the @wymp/ts-sql package, so the keys were changed here to accommodate.

You'll typically translate the Client.CollectionParams into this type by analyzing the incoming request.

Type declaration

  • Optional __pg?: {
        size?: number;
        cursor?: string | null;
    }

    Pagination options

    • Optional size?: number

      The size of the page

    • Optional cursor?: string | null

      The cursor indicating which page to retreive. This value is intentionally opaque, and is meant to be both consumed and produced by the underlying system. Often, it will simply be a base64-encoded string indicating a page number, such as num:5.

  • Optional __sort?: string

    How to sort the collection. This should be a comma-separated list of sort fields using either + (implied) or - to indicate sort order.

Generated using TypeDoc