Skip to content

Pagination using limit and offset query parameters #5

@peterhartman-90poe

Description

@peterhartman-90poe

I have an API that achieves pagination using query parameters in the URL. The maximum items returned is 50 so an offset/skip is needed to retrieve the full dataset

Is this possible using the library as-is? I have hacked it for now by adding a "skip" parameter to the resource that gets passed as a filter

read(:list_companies) do
    argument :skip, :integer do
        allow_nil? true
        default 0
    end

    filter expr(skip == ^arg(:skip))
end

The limit is working nicely as-is:

limit_with {:param, "limit"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions