Barelydead / strapi-plugin-populate-deep

A Strapi plugin that makes it easier to populate deep content structures
172 stars 39 forks source link

Not working with other query params #3

Closed gonzam88 closed 2 years ago

gonzam88 commented 2 years ago

Currently trying to filter and deep populate. Adding filters brakes puplate=deep

Example query

http://localhost:1337/api/experiences?populate=deep,10 😇 works perfectly

http://localhost:1337/api/experiences?filters[slug][$eq]=my-slug&populate=deep,10 😭 not working

Thanks in advance for this plugin. Strapi should work like this by default

Barelydead commented 2 years ago

Hi @gonzam88,

Thanks for the feedback I will look into it when i get the chance. What kind of problem do you get when trying to filter? Error response or just unpopulated entries?

gonzam88 commented 2 years ago

Unpopulated entries, like it doesn't find anything

{ "data": [], "meta": { "pagination": { "page": 1, "pageSize": 25, "pageCount": 0, "total": 0 } } }

Barelydead commented 2 years ago

Hi, I just tried it with a fresh install and it seems to be working as intended. Maybe you could try with a smaller depth? Go with deep,1 -> deep,2 -> and so on and see if it makes a difference.

/api/posts?filters[title][$eq]=second&populate=deep,10


"data": [
{
"id": 2,
"attributes": {
"title": "second",
"createdAt": "2022-03-17T21:57:46.185Z",
"updatedAt": "2022-03-17T21:57:51.665Z",
"publishedAt": "2022-03-17T21:57:51.665Z",
"media": {
"data": [
{
"id": 1,
"attributes": {
"name": "Predator_3840x2160.jpg",
"alternativeText": "Predator_3840x2160.jpg",
"caption": "Predator_3840x2160.jpg",
"width": 3840,
"height": 2160,
"formats": {
"thumbnail": {
"name": "thumbnail_Predator_3840x2160.jpg",
"hash": "thumbnail_Predator_3840x2160_16dbc10cfa",
"ext": ".jpg",
"mime": "image/jpeg",
"path": null,
"width": 245,
"height": 138,
"size": 3.25,
"url": "/uploads/thumbnail_Predator_3840x2160_16dbc10cfa.jpg"
},
"large": {
"name": "large_Predator_3840x2160.jpg",
"hash": "large_Predator_3840x2160_16dbc10cfa",
"ext": ".jpg",
"mime": "image/jpeg",
"path": null,
"width": 1000,
"height": 563,
"size": 20.01,
"url": "/uploads/large_Predator_3840x2160_16dbc10cfa.jpg"
},
"medium": {
"name": "medium_Predator_3840x2160.jpg",
"hash": "medium_Predator_3840x2160_16dbc10cfa",
"ext": ".jpg",
"mime": "image/jpeg",
"path": null,
"width": 750,
"height": 422,
"size": 13.36,
"url": "/uploads/medium_Predator_3840x2160_16dbc10cfa.jpg"
},
"small": {
"name": "small_Predator_3840x2160.jpg",
"hash": "small_Predator_3840x2160_16dbc10cfa",
"ext": ".jpg",
"mime": "image/jpeg",
"path": null,
"width": 500,
"height": 281,
"size": 8.39,
"url": "/uploads/small_Predator_3840x2160_16dbc10cfa.jpg"
}
},
"hash": "Predator_3840x2160_16dbc10cfa",
"ext": ".jpg",
"mime": "image/jpeg",
"size": 123.32,
"url": "/uploads/Predator_3840x2160_16dbc10cfa.jpg",
"previewUrl": null,
"provider": "local",
"provider_metadata": null,
"createdAt": "2022-03-17T21:56:29.961Z",
"updatedAt": "2022-03-17T21:56:29.961Z"
}
}
]
}
}
}
],
"meta": {
"pagination": {
"page": 1,
"pageSize": 25,
"pageCount": 1,
"total": 1
}
}
}