Hey Simon Espigolé, happy you liked my post. I'm not familiar with Spring Boot, but the principle is usually the same. If you're using an OR mapper (such as Prisma for example), you can "include" or "expand" related entities and load them from the database in one go.
The flow would roughly look like this:
- API accepts an
expand parameter for GET requests
- The expand parameter is interpreted and passed to the OR mapper
- Entities are loaded from the database and passed back as response
Check out the Prisma documentation for more details:
prisma.io/docs/concepts/components/prisma-client/…
If you have any questions, just let me know.