Skip to content

Commit

Permalink
updated ListResolver documentation to reflect new sorting syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-cirieco committed Jun 28, 2024
1 parent 874cbd3 commit 7c84bdd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/magql_sqlalchemy/resolvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,12 @@ class ListResolver(QueryResolver):
once for large data sets. The default ``page`` is 1. The default ``per_page`` is
10, with a max of 100.
The ``sort`` argument is a list of ``(name: str, desc: bool)`` items from the
:attr:`.ModelManager.sort` enum. By default the rows are sorted by their primary key
column, otherwise the order wouldn't be guaranteed consistent across pages.
The ``sort`` argument is a list of column names from the :attr:`.ModelManager.sort`
enum. By default the rows are sorted by their primary key column, otherwise the
order wouldn't be guaranteed consistent across pages. To sort in descending order,
prepend a `-` to the column name.
E.g. ``sort: ["-column_name"]``
Filtering applies one or more filter rules to the query. The ``filter`` argument is
a list of lists of rules. Each rule is a ``{path, op, not, value}`` dict. The rules
Expand Down

0 comments on commit 7c84bdd

Please sign in to comment.