From d70bd55ace1779e4b91b3b61759769eff75ed327 Mon Sep 17 00:00:00 2001 From: Kyrch Date: Thu, 24 Jul 2025 20:37:32 -0300 Subject: [PATCH] docs(graphql): added filtering section (#110) (cherry picked from commit b07c916d6812831f026a20d1f167b672870d4368) --- docs/guide/graphql/filtering/index.md | 80 ++++++++++++++++++++++++++- 1 file changed, 78 insertions(+), 2 deletions(-) diff --git a/docs/guide/graphql/filtering/index.md b/docs/guide/graphql/filtering/index.md index bdbeba1..9c1cbba 100644 --- a/docs/guide/graphql/filtering/index.md +++ b/docs/guide/graphql/filtering/index.md @@ -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. \ No newline at end of file +## 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 + } + } + } +} +``` \ No newline at end of file