Flop.Meta (Flop v0.13.2) View Source
Defines a struct for holding meta information of a query result.
Link to this section Summary
Link to this section Types
Specs
t() :: %Flop.Meta{
current_offset: non_neg_integer() | nil,
current_page: pos_integer() | nil,
end_cursor: String.t() | nil,
flop: Flop.t(),
has_next_page?: boolean(),
has_previous_page?: boolean(),
next_offset: non_neg_integer() | nil,
next_page: pos_integer() | nil,
page_size: pos_integer() | nil,
previous_offset: non_neg_integer() | nil,
previous_page: pos_integer() | nil,
start_cursor: String.t() | nil,
total_count: non_neg_integer() | nil,
total_pages: non_neg_integer() | nil
}
Meta information for a query result.
:flop- TheFlopstruct used in the query.:current_offset- The:offsetvalue used in the query when using offset-based pagination or a derived value when using page-based pagination. Alwaysnilwhen using cursor-based pagination.:current_page- The:pagevalue used in the query when using page-based pagination or a derived value when using offset-based pagination. Note that the value will be rounded if the offset lies between pages. Alwaysnilwhen using cursor-based pagination.:previous_offset,:next_offset,:previous_page,:next_page- Values based on:current_pageand:current_offset/page_size. Alwaysnilwhen using cursor-based pagination.:start_cursor,:end_cursor- The cursors of the first and last record in the result set. Only set when using cursor-based pagination with:first/:afteror:last/:before.:has_previous_page?,:has_next_page?- Set in all pagination types. Note that:has_previous_page?is alwaysfalsewhen using cursor-based pagination with:first/afterand:has_next_page?is alwaysfalsewhen using cursor-based pagination with:last/:before.:page_size- The page size or limit of the query. Set to the:firstor:lastparameter when using cursor-based pagination.:total_count- The total count of records for the given query. Alwaysnilwhen using cursor-based pagination.:total_pages- The total page count based on the total record count and the page size. Alwaysnilwhen using cursor-based pagination.