mirror of
https://github.com/AnimeThemes/animethemes-api-docs.git
synced 2026-07-11 01:34:06 +02:00
docs(graphql): added filtering section (#110)
(cherry picked from commit b07c916d68)
This commit is contained in:
@@ -6,6 +6,82 @@ title: Filtering
|
||||
|
||||
---
|
||||
|
||||
// TODO
|
||||
Most queries provide filtering arguments using the AND operator. Filtering arguments are built using `{fields}_{filter}`.
|
||||
|
||||
// Note: Waiting API refactor.
|
||||
## All Filters
|
||||
|
||||
* Eq: `name` (without the filter argument)
|
||||
* Like: `name_like`
|
||||
* In: `id_in`
|
||||
* Not in: `id_not_in`
|
||||
* Greater: `id_greater`
|
||||
* Lesser: `id_lesser`
|
||||
|
||||
Query example:
|
||||
```graphql
|
||||
query {
|
||||
animes(name_like: "%monogatari%") {
|
||||
data {
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Available Filters for the fields
|
||||
|
||||
### String Fields
|
||||
|
||||
* Eq
|
||||
* Like
|
||||
|
||||
### Int Fields
|
||||
|
||||
* Eq
|
||||
* In
|
||||
* Not in
|
||||
* Greater
|
||||
* Lesser
|
||||
|
||||
### Float Fields
|
||||
|
||||
* Eq
|
||||
* In
|
||||
* Not in
|
||||
* Lesser
|
||||
* Greater
|
||||
|
||||
### Boolean Fields
|
||||
|
||||
* Eq
|
||||
|
||||
### Enum Fields
|
||||
|
||||
* Eq
|
||||
* In
|
||||
* Not in
|
||||
|
||||
### DateTimeTz Fields
|
||||
|
||||
* Eq
|
||||
* Greater
|
||||
* Lesser
|
||||
|
||||
|
||||
## Nested Filtering
|
||||
|
||||
Filtering in relationships is applied **ONLY** on the relationship and it doesn't affect the previous root.
|
||||
|
||||
```graphql
|
||||
query {
|
||||
animes {
|
||||
data {
|
||||
name
|
||||
animethemes(type: OP) {
|
||||
type
|
||||
sequence
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user