Parameters should be placed under query arguments as below:
where: {column-a: {operator: value} column-b: {operator: value}}
AND / OR group can be created as clause lists in and / or parameter under where.
- Supported operators are
eq,ne,gt,lt,gte,lte,inandlike.- Multiple filters are applied with
ANDoperator.
Users where name is like ken AND age is 20 OR 21.
{users (where: {name: {like: "%ken%"} or: [{age: {eq: 20}}, {age: {eq: 21}}]})}
Parameters should be placed under query arguments as below:
sort: {[column]: [asc or desc]}
Sort by id column in ascending order.
sort: {id: asc}
Parameters should be placed under query arguments as below:
limit: [count]
offset: [count]
limitandoffsetcan be used independently.- Using
offsetcan return different results when new entries are created while items are sorted by newest first. So usinglimitwithidfilter orcreated_atfilter is often considered more consistent.
25 items after/greater than id:20
(where: {id: {gt: 20}} limit: 25)
avg, count, max, min and sum are supported and it can also be filtered.
Select count of cart_items together with max, min sum and avg of price where cart_id is 1.
cart_items_aggregate (where: {cart_id: {eq: 1}}) {count max {price} min {price} avg {price} sum {price}}
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |