Skip to main content

Filtering

Filtering in query-graphql has has an object based syntax

For a full reference of filter operations see filter reference

The following example filters for all todoItems that are marked completed.

{
todoItems(filter: {completed: {is: true}}){
pageInfo{
hasNextPage
hasPreviousPage
startCursor
endCursor
}
edges{
node{
id
title
completed
created
updated
}
cursor
}
}
}

Setting the generated filter-type depth

When querying the default filter is one level deep. You can specify the generated filter-type depth by using the QueryOptions decorator on your DTO.

You can find the documentation and an example in the QueryOptions reference.

Setting a default filter

When querying the default filter is empty. You can specify a default filter by using the QueryOptions decorator on your DTO.

You can find the documentation and an example in the QueryOptions reference.

Setting allowed boolean expressions

When filtering you can provide and and or expressions to provide advanced filtering. You can turn off either by using the QueryOptions decorator on your DTO.

You can find the documentation and an example in the QueryOptions reference.