GraphQL Filter Specifications: QBE
While you can perform equality comparisons using GraphQL arguments, you can perform all other comparisons using the query-by-example (QBE) syntax.
QBE is analogous to where
clause in SQL queries and is a
slightly modified form of SODA QBE expression. To use this
feature, you can specify the list of predicates for a table in the check clause, and
this clause is specified after the table name and before the list of directives.
For example, driver(check:{points:{_gt: 360}})
.
Each predicate has the alias name for the column, followed by a QBE operator
and then the comparison value. In the example above, points
is the
alias, _GT
is the operator which will perform greater than
operation and 360
is the comparison value, this is equivalent
to "where points > 360
".
- Relational Operators : Includes comparison
operators such as
_eq
(equal to),_ne
(not equal to) etc. - Logical Operators: Includes operators such as
_and
and_or
to combine the predicates. - Item Method Operators: Includes operators such as
_lower
,_upper
etc., which transforms the value and then uses for further filtering.