Skip to content

Commit a70a1f6

Browse files
authored
Document child entity filtering (#159)
* Document child entity filtering * Use "nested" instead of "child"
1 parent 7b72ab1 commit a70a1f6

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

pages/en/querying/graphql-api.mdx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,30 @@ This can be useful if you are looking to fetch only entities which have changed,
150150
}
151151
```
152152

153+
#### Example for nested entity filtering
154+
155+
Filtering on the basis of nested entities is possible in the fields with the `_` suffix.
156+
157+
This can be useful if you are looking to fetch only entities whose child-level entities meet the provided conditions.
158+
159+
```graphql
160+
{
161+
challenges(where: { application_: { id: 1 } }) {
162+
challenger
163+
outcome
164+
application {
165+
id
166+
}
167+
}
168+
}
169+
```
170+
153171
#### All Filters
154172

155173
Full list of parameter suffixes:
156174

157175
```
176+
_
158177
_not
159178
_gt
160179
_lt
@@ -176,7 +195,7 @@ _not_ends_with
176195
_not_ends_with_nocase
177196
```
178197

179-
> Please note that some suffixes are only supported for specific types. For example, `Boolean` only supports `_not`, `_in`, and `_not_in`.
198+
> Please note that some suffixes are only supported for specific types. For example, `Boolean` only supports `_not`, `_in`, and `_not_in`, but `_` is available only for object and interface types.
180199
181200
In addition, the following global filters are available as part of `where` argument:
182201

0 commit comments

Comments
 (0)