woylie/flop

How to have a page_size larger than 1000?

Closed this issue · 2 comments

Is there a way to define a page_size larger than 1000?

Currently, if I try to have a larger page size, I get a validation error regarding this, but I might want to have larger pages.

no match of right hand side value: {:error, %Flop.Meta{backend: nil, current_offset: nil, current_page: nil, end_cursor: nil, next_offset: nil, next_page: nil, page_size: nil, previous_offset: nil, previous_page: nil, schema: nil, start_cursor: nil, total_count: nil, total_pages: nil, errors: [page_size: [{"must be less than or equal to %{number}", [validation: :number, kind: :less_than_or_equal_to, number: 1000]}]], flop: %Flop{after: nil, before: nil, first: nil, last: nil, limit: nil, offset: nil, order_by: nil, order_directions: nil, page: nil, page_size: nil, decoded_cursor: nil, filters: []}, has_next_page?: false, has_previous_page?: false, opts: [], params: %{"page" => 1, "page_size" => 1001}}}

The page size is limited by the max_limit option. You can set it by passing it directly to the validate or validate_and_run function, or via the application environment, or via config module, or in the schema configuration.

Cool, thanks for the help!