Extensions are helper modules or classes we ship with Praxis that extend the default functionality. They can be extremely useful to reuse pattern, reuse boilerplate or provide common functionality. However, they are completely optional and must be explicitly required when you choose to use them.
Praxis currently includes the following extensions, all under the
FieldSelection: adds an enhanced version of
Attributor::FieldSelectorsuitable for defining API parameters that describe which fields to return in responses. I.e. a compatible (yet simplified) GraphQL type syntax for field selection.
displayhelper methods to controllers to reduce common boilerplate in producing rendered representations of media types and setting response “Content-Type” headers.
Controller#set_selectors, which sets selectors in the controller’s
identity_mapto ensure any fields and associations necessary to render the
:fieldsparams specified in the request are loaded for a given model when
Controller#expanded_fieldshelper for processing
:fieldsparams to determine the final set fields necessary to handle the request.