You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The orderings option allows for sorting query results. The client currently accepts a string in the format expected by Prismic's Rest API or an object describing a sorting.
Is your feature request related to a problem? Please describe.
The
orderings
option allows for sorting query results. The client currently accepts a string in the format expected by Prismic's Rest API or an object describing a sorting.String:
Object:
The second option is clearer to read, is typed via TypeScript, and shows that multiple orderings can be provided (as a result of it being an array).
The first option is easy to write incorrectly, provides no compile-time checks, and requires learning a new syntax.
Describe the solution you'd like
Deprecate string values for the
orderings
option and only allow the object version.Additionally,
orderings
currently accepts a single value or an array. The type should be changed to only accept an array.Describe alternatives you've considered
None :)
Additional context
This request was prompted by this Prismic Community question: https://community.prismic.io/t/how-to-sort-prismic-data-by-name-or-any-other-field/11793
The text was updated successfully, but these errors were encountered: