3 ms·
I was just thinking about it yesterday! It would be a nice way to implement REST APIs for related resources. For example, if we have a /books collection with r
by notpushkin 2y ago
I was just thinking about it yesterday! It would be a nice way to implement REST APIs for related resources.
For example, if we have a /books collection with related authors for each book, client could request books with authors. Server would then fetch the books and authors in a single DB request, return just the books, and push each author as an additional response.
Of course, this can be implemented with other mechanisms (JSON:API [0] comes to mind), but this seemed like a nice idea to explore. Guess we’ll never know!
[0]: https://jsonapi.org/ https://jsonapi.org/