Rest api returns only 2 levels of collections. After 2 levels only the ids of the collection are returned. What is the simplest way to modify the levels returned without using graphql?
Being able to specify either ids or the entire relation object would be great.
e.g. The /user/ route and the /auth/local route both reference the User.setting.json model. But only the /user/ route references the User controller.
EDIT:
I now see how to populate only specific relations including child relations. Very cool!
We use to have a setting autoPopulate which enables the population of every relational field by default. It might worth it to remove it and replace it with a more precise setting such as populate which could accept multiple values.
populate: all would have the same behavior as the autoPopulate by populating the first level of relational fields.
populate: ['category', 'category.tags'] would only populate the category field at the first level and the tags relational field at the second level.
populate: ['category', 'category.tags.name'] would only populate the category field at the first level, and the tags relational field at the second level by only returning the name of it.
IMO, itâs very close to an advanced query system that we could implement in the REST API. I donât know what we have in mind regarding this and the v4 (cc @alexandrebodin)
It has changed in the stable, but in v4 we have an entirely new population system coming that will give a lot of freedom and will be implemented in a very easy way.
Cool â it looks like I could graphQL for now â I am trying to get a more full structure for passing by our VueJS front end â so it doesnât need to make additional requests to get more data.
Beta will likely be sometime late Q3, first âstableâ release will be early Q4 to late Q4. It largely depends on how quickly we can make the changes. There are about 4 projects being worked on in parallel for the v4 but database layer changes wonât start until early Q3.
I have v4 installed right now, but relation fields are not being returned. Also, cannot find any docs to the âentirely new population systemâ. Any help would be appreciated. Iâm not using GraphQL and would like to use relation fields if they are returned in API queries.