My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

What strategy would you use to handle complex API output?

Emil Moe's photo
Emil Moe
·Jan 16, 2017

I need to output a lot of different data in 1 API call, in order to save overhead, how would you do this?

I have thought about different strategies:

  1. Make one big repository that handles everything (probably not a very maintanable way of doing it, but is an option no matter what)
  2. Split the API into many different endpoints targeted one purpose each, however I don't want more requests than necessary, so these must be combined either in the repository or maybe I should make some form of entry-endpoint and the ability to add on what other endpoints should be merged into the output?

Would you consider something of the second approach?