3 ms·
If you must, serve up the authors as an array that is a sibling of the posts array. So if you have 100 posts written by only 3 authors, you have: { post
by biot 10y ago
If you must, serve up the authors as an array that is a sibling of the posts array. So if you have 100 posts written by only 3 authors, you have:
{
posts: [ /* 100 records */ ],
authors: [ /* 3 records */ ]
}
Each post references the author by ID only and all required data is sent in one API call.
- _asummers 10y agoEven better: make authors be a map of ID to author so you can get fast lookup by ID when you need it.