The populate deep plugin will query all the data, not just the data I specify, which will impact performance of the app. We currently don’t recommend the use of the populate deep plugin and have removed in from the Strapi Marketplace.
Hay Paul,I love the flatten attributes function! my question: with strapi 5 coming out is refactoring my next app to use this shared flatten attributes function a good first step, or will Strapi 5 do something with its new api format that means this flatten attributes function will not be required in the future?
These posts are just what I was looking for! Thank you for your easy explanation.
I may be mistaken, but I think label props in Link type on line 10 is text. (repo is correct though
The code below the sentence “Let’s create the following interfaces. ”
Thanks. This is a good approach for v4 projects and will make upgrading to v5 much easier.
With v5, we will already have the flattened response, which will require us to make some minimal changes in the front end.
We would need to remove the flatten attributes function and make some minor updates on our front end, if any.
Which will be nice. I will make a post about the migration process when v5 is out.
As for something I have been doing in my personal projects, I am not sure if it is good advice, but I have been playing with the idea of having an intermediate data connecter function, which takes an API response and converts it to what the front end expects.
So when I have a new API response structure, I don’t have to update all of my frontends, just the intermediary function.
I am sure this approach has some issues that I did not find yet.
I just wanted to add some context for why I added the flattened attribute function in the first place.