How to populate specific fields?

This is the example of my data using this query params:
{{host}}/api/categories?populate=*

{ "data": [ { "id": 1, "attributes": { "title": "Test, "landing_page_helps": { "data": [ { "id": 1, "attributes": { "title": "Test Title", "content": "content", "slug": "slug", } } ] } } }, ] }

i only want to receive title and slug on landing_page_helps relations
expected:
{
“data”: [
{
“id”: 1,
“attributes”: {
“landing_page_helps”: {
“data”: [
{
“id”: 1,
“attributes”: {
“title”: “Test Title”,
“slug”: “slug”,
}
}
]
}
}
},
]
}

how to do it?

This topic has been created from a Discord post (1293837184926748755) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord

try it like this

{
  populate: {
    landing_page_helps: {
      fields: ['title', 'slug']
    }
  },
}

→ /api/categories?populate[landing_page_helps][fields][0]=title&populate[landing_page_helps][fields][1]=slug
use Interactive Query Builder | Strapi 5 Documentation

yep. use qs library

thanks a lot!!