Skip to content

Commit 791fb8c

Browse files
committed
Note that REST filter examples need populate to surface traversed relations
1 parent fc2e7e3 commit 791fb8c

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

docusaurus/docs/cms/api/rest/filters.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,11 @@ await request(`/api/books?${query}`);
293293
</Response>
294294
</ApiCall>
295295

296+
:::note
297+
The response above only contains a book's own attributes. The `author` relation traversed by the `$and` filter is not returned unless requested through the [`populate` parameter](/cms/api/rest/populate-select#population), for example by adding `&populate=author` to the request.
298+
:::
299+
300+
296301
## Deep filtering
297302

298303
Deep filtering is filtering on a relation's fields.
@@ -369,3 +374,8 @@ await request(`/api/restaurants?${query}`);
369374

370375
</Response>
371376
</ApiCall>
377+
378+
:::note
379+
The response above mirrors the default REST output, which excludes the relations traversed by the filter. Add a [`populate` parameter](/cms/api/rest/populate-select#population) such as `&populate[chef][populate][restaurants]=true` to also return the `chef.restaurants` relation referenced in the filter.
380+
:::
381+

0 commit comments

Comments
 (0)