Expand description
Boolean expression input types.
Hasura’s filter argument is where: <table>_bool_exp – a generated input
object with one field per column, one per relationship, and _and, _or
and _not for structure:
author(where: {_and: [{id: {_gt: 2}},
{articles: {title: {_ilike: "%rust%"}}}]}) { id }The shape matters more than it looks. A JSON argument accepts the same
text, but nothing downstream can read it: a client cannot generate types
from it, an editor cannot complete it, and a typo in an operator name
reaches the server instead of being refused by the client. Every case in
Hasura’s introspection corpus turns on these types existing, and so does
every graphql-codegen run a migrating client has in its build.
Two naming rules, both taken from what a client has already compiled against rather than from taste:
- The table’s expression is
<table>_bool_exp, named for the table exactly as it is spelled in PostgreSQL. It appears in the client’s own source wherever a query declares a variable. - A column’s expression is named for the column’s scalar type, so every
textcolumn in the schema shares oneString_comparison_exp.
Constants§
- AGGREGATE_
PREDICATES - The aggregates a predicate may be written over.
Functions§
- aggregate_
bool_ exp_ columns - The name of the enum naming the columns
bool_andandbool_ormay take. - aggregate_
bool_ exp_ function - The name of one aggregate’s own input inside that.
- aggregate_
bool_ exp_ type_ name - The name of a table’s aggregate boolean expression input.
- bool_
exp_ type_ name - The name of a table’s boolean expression input.
- build_
inputs - Every input type the boolean expressions need, ready to register, and every scalar those inputs name.
- comparison_
type_ name - The name of the comparison input for a scalar.
- ltree_
operator - The operator each tree comparison becomes, and what its operand is cast to.
- postgis_
function - The PostGIS function behind each of those, and behind the ones that take more than a shape.