Command Palette

Search for a command to run...

GraphQL Filtering

Pass filters to list queries through the filter input. For the SDK filter syntax, see Filtering & Sorting.

Conditions

Each condition specifies a field, operator, and value:

query
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 query { customerList( filter: { query: [{ condition: { field: "name" operator: ilike value: "%john%" } }] } ) { data { id name } } }

The operator set matches the SDK operators: see the operator tables. In GraphQL, operators are enum values without quotes (operator: ilike).

AND conditions

query
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 query { customerList( filter: { query: [{ and: [ { condition: { field: "status" operator: equal value: "active" } } { condition: { field: "created_at" operator: greaterThan value: "2024-01-01" } } ] }] } ) { data { id name status created_at } } }

OR conditions

query
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 query { customerList( filter: { query: [{ or: [ { condition: { field: "status" operator: equal value: "active" } } { condition: { field: "status" operator: equal value: "pending" } } ] }] } ) { data { id name status } } }

Filtering relations

Use dot notation to filter by related fields:

query
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 query { orderList( filter: { query: [{ condition: { field: "customer.name" operator: ilike value: "%acme%" } }] } ) { data { id total customer { data { name } } } } }

Sorting

query
1 2 3 4 5 6 7 8 9 10 11 12 query { customerList( filter: { sortby: [ { field: "status", order: asc } { field: "created_at", order: desc } ] } ) { data { id name status created_at } } }

Sorting by related fields also uses dot notation (field: "customer.name").