Sign in
Log inSign up

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?

Hassle-free blogging platform that developers and teams love.
  • Docs by Hashnode
    New
  • Blogs
  • AI Markdown Editor
  • GraphQL APIs
  • Open source Starter-kit

© Hashnode 2024 — LinearBytes Inc.

Privacy PolicyTermsCode of Conduct