Query Filter API Each field type provides its own set of filters which can be used with queries .
This page lists all the filters available for each field type.
For more details on how to use filters in queries please consult to the GraphQL Queries - Filters guide.
Keystone filters are typically named after the field they are filtering. For example, a text
field called foo
would have filters named foo_starts_with
, foo_contains
, etc.
In all the examples below we will use a field named foo
as the base of the filter names.
Scalar types checkboxFilter name Type Description foo
Boolean
Equals foo_not
Boolean
Does not equal
integerFilter name Type Description foo
Int
Equals foo_not
Int
Does not equal foo_lt
Int
Less than foo_lte
Int
Less than or equal foo_gt
Int
Greater than foo_gte
Int
Greater than or equal foo_in
[Int]
Is in the array foo_not_in
[Int]
Is not in the array
jsonThe json
field type does not support filters.
floatFilter name Type Description foo
Float
Equals foo_not
Float
Does not equal foo_lt
Float
Less than foo_lte
Float
Less than or equal foo_gt
Float
Greater than foo_gte
Float
Greater than or equal foo_in
[Float]
Is in the array foo_not_in
[Float]
Is not in the array
passwordFilter name Type Description foo_is_set
Boolean
A value is set
selectFilter name Type Description foo
String
Equals foo_not
String
Does not equal foo_in
[String]
Is in the array foo_not_in
[String]
Is not in the array
textFilter name Type Description ** Notes ** foo
String
Equals foo_not
String
Does not equal foo_contains
String
Contains foo_not_contains
String
Does not contain foo_starts_with
String
Starts with postgresql
onlyfoo_not_starts_with
String
Does not start with postgresql
onlyfoo_ends_with
String
Ends with postgresql
onlyfoo_not_ends_with
String
Does not end with postgresql
onlyfoo_i
String
Equals (case insensitive) postgresql
onlyfoo_not_i
String
Does not equal (case insensitive) postgresql
onlyfoo_contains_i
String
Contains (case insensitive) postgresql
onlyfoo_not_contains_i
String
Does not contain (case insensitive) postgresql
onlyfoo_starts_with_i
String
Starts with (case insensitive) postgresql
onlyfoo_not_starts_with_i
String
Does not start with (case insensitive) postgresql
onlyfoo_ends_with_i
String
Ends with (case insensitive) postgresql
onlyfoo_not_ends_with_i
String
Does not end with (case insensitive) postgresql
onlyfoo_in
[String]
Is in the array foo_not_in
[String]
Is not in the array
timestampFilter name Type Description foo
String
Equals foo_not
String
Does not equal foo_lt
String
Less than foo_lte
String
Less than or equal foo_gt
String
Greater than foo_gte
String
Greater than or equal foo_in
[String]
Is in the array foo_not_in
[String]
Is not in the array
Relationship type relationship many: trueFilter name Type Description foos_every
FooWhereInput
All related items match the nested filter foos_some
FooWhereInput
Some related items match the nested filter foos_none
FooWhereInput
No related items match the nested filter
many: falseFilter name Type Description foo
FooWhereInput
Matches the nested filter foo_is_null
Boolean
Is null
Index types autoIncrementFilter name Type Description id
ID
Equals id_not
ID
Does not equal id_lt
ID
Less than id_lte
ID
Less than or equal id_gt
ID
Greater than id_gte
ID
Greater than or equal id_in
[ID]
Is in the array id_not_in
[ID]
Is not in the array
Virtual type virtualThe virtual
field type does not support filters.
File types fileThe file
field type does not support filters.
imageThe image
field type does not support filters.