hydra
Search…
The Goodies
The output schema automatically supports OpenCRUD filtering, pagination and ordering

Filtering

All the scalar entity types enjoy first-class support in the output schema when it comes to filtering. The standard is known as OpenCRUD and dictates what the filtering should look like depending on the field type. For example, if the input schema defines the following type:
1
type Person @entity {
2
name: String!
3
married: Boolean
4
age: Int
5
account: Bytes! @unique
6
salary: BigInt
7
interests: [String]
8
}
Copied!
the output schema will support the following query:
1
query {
2
persons(where: { name_startsWith: "Joh", age_gt: 20 }) {
3
name
4
}
5
}
Copied!

Pagination

All queries enjoy pagination support by accepting offset and limit input parameters. By default, limit is set to 5.
1
query {
2
persons(offset: 10, limit: 5) {
3
name
4
}
5
}
Copied!

Ordering

The results can also be ordered by any property with natural ordering. The _DESCand _ASC suffixes indicate the direction:
1
query {
2
persons(offset: 10, limit: 5, orderBy: name_ASC) {
3
name
4
}
5
}
Copied!
Last modified 8mo ago