Hi folks,
I want to populate data two levels deep. Therefore I wrote the following:
let homepage = qs.stringify({
populate: '*',
},{
encodeValuesOnly: true, // prettify URL
});
This returns the following JSON:
{
"data": {
"id": 1,
"attributes": {
},
"Kompetenzen": {
},
"Faehigkeiten": {
},
"Techstack": {
},
"Stationen": [],
"Projekte": {
}
}
},
"meta": {}
}
The nested Object āProjekteā now does contain an image. How can I access it?
1 Like
Here for the same reason. All the docs and StackOverflow posts I see seem to claim that having the populate: '*'
will get you nested images, but itās not happening for me either.
Hope someone can help.
Itās a bit annoying, I couldnāt find an answer neither on stackoverflow nor here. As per my understanding populate: ā*ā does usually only populate data from the first level.
I think that nested Objects can be accessed with something like
populate: [ā*ā,
{ populalate: āProjekte.Imgā
}]
Itās not really straight forwardā¦
1 Like
Yeah same. Not ideal but in short term I added strapi-plugin-populate-deep
npm package to my strapi code and now on frontend Iām tacking &populate=deep
onto the end of any queries where I need those images nested 2 levels deep.
Itās a way to solve it, but this plugin only supports node up to v14, which means I would have to downgrade, which gives me only more headache with strapi 