System Information
- Strapi Version: 4.1.0
- Operating System: macOS Monterey
- Database: sqllite
- Node Version: 14.17.3
- NPM Version: 6.14.13
- Yarn Version: 1.22.10
Consider a collection type, Page, which has two fields, a title of type text and sessions of type dynamic zone.
To simplify, let’s consider that the dynamic zone only accepts one type of component, carrousel.
The carrousel component has two fields, title of type text and items of type Component (repeatable). The component within items is the carrouselItem which has two fields description and image.
I’ve then added data:
After that I tried to query the data with http://localhost:1337/api/pages?populate=*
but I did not get all the nested data within the dynamic zone:
{
"data": [
{
"id": 1,
"attributes": {
"title": "test",
"createdAt": "2022-02-20T05:39:14.275Z",
"updatedAt": "2022-02-20T05:47:17.626Z",
"publishedAt": "2022-02-20T05:47:17.625Z",
"sessions": [
{
"id": 1,
"__component": "session.carrousel",
"title": "test"
}
]
}
}
],
"meta": {
"pagination": {
"page": 1,
"pageSize": 25,
"pageCount": 1,
"total": 1
}
}
}
I did some research and found this suggestion, https://forum.strapi.io/t/strapi-v4-populate-media-and-dynamiczones-from-components/12670/3
. I went ahead and added the helper to my code base and modified the home controller.
Unfortunately, that didn’t change my query result and I’m still not getting the expected nested content.
note: I’ve also tried to fetch the data with http://localhost:1337/api/pages?populate[sessions][populate][carrousel][populate][carrouselItem][populate]=*
but got the same result.