Skip to main content

Module query

Module query 

Source
Expand description

?page[…] and ?sort= — parsed, checked, and handed to storage.

A collection request carries its paging and ordering in the query string. This module turns that string into typed values, rejecting what is malformed before storage is touched, so a List implementation receives something it can use rather than raw strings it has to re-parse.

Every failure here is a 400 carrying source.parameter, which is what JSON:API names for a bad query parameter — the counterpart to the source.pointer a bad document member gets.

Structs§

Paginator
Build a collection’s pagination links.
Query
Everything a collection request asked for.
Sort
One ?sort= key: a field, and its direction.

Enums§

Page
Which page of a collection the client asked for.

Constants§

DEFAULT_PAGE_SIZE
How many resources a page holds when the client does not say.
MAX_PAGE_SIZE
The largest page a client may ask for.