View Source QueryElf.Plugins.OffsetPagination (query_elf v0.4.1)

Plugin to enable limit-offset based pagination in any query builder.

It accepts the following options:

  • :default_per_page - the default value of items per page (default: 25)

Example

defmodule MySchemaQueryBuilder do
  use QueryElf,
    schema: MySchema,
    plugins: [QueryElf.Plugins.OffsetPagination]
end

MySchemaQueryBuilder.build_query([], page: 2, per_page: 25)