class Praxis::Extensions::Pagination::PaginationParams::DSLCompiler

DSL for definition pagination parameters in a defined filter. Available options are:

One can limit which fields the pagination (by cursor) can be allowed. Typically only indexed fields should be allowed for performance reasons:

* by_fields <Array of field names>  (if not provided, all fields are allowed)

One can limit the total maximum of items of the requested page size from the client can ask for:

* max_items <integer> (there is a static upper limit to thie value set by the MAX_ITEMS constant)

One can set the default amount of items to return when not specified by the client

* page_size <integer> (less or equal than max_items, if the max is set)

One can expicitly disallow either paging or cursor based pagination (by default both are allowed)

One can set the default pagination mode when no :page, :by/:from parameters are passed in.

Here’s a full example: attribute :pagination, Types::PaginationParams.for(MediaTypes::Book) do

by_fields :id, :name
max_items 500
page_size 50
disallow :paging
default by: :id

end