Ash.Sort.parse_input
You're seeing just the function
parse_input
, go back to Ash.Sort module for more information.
Specs
parse_input( Ash.Resource.t(), String.t() | [atom() | String.t() | {atom(), sort_order()} | [String.t()]] | nil ) :: {:ok, t()} | {:error, term()}
A utility for parsing sorts provided from external input. Only allows sorting on public attributes and aggregates.
The supported formats are:
Sort Strings
A comma separated list of fields to sort on, each with an optional prefix.
The prefixes are:
- "+" - Same as no prefix. Sorts
:asc
. - "++" - Sorts
:asc_nils_first
- "-" - Sorts
:desc
- "--" - Sorts
:desc_nils_last
For example
"foo,-bar,++baz,--buz"
A list of sort strings
Same prefix rules as above, but provided as a list.
For example:
["foo", "-bar", "++baz", "--buz"]