DEV Community

Discussion on: Best practices querying APIs via cloud functions

Collapse
 
rcarlson profile image
Robert Carlson • Edited

Great question, when building an API you should always consider your audience. An API is meant to communicate what can be done?. With that in mind, I would always encourage functions specific to the data it manipulates.

That being said, if your API allows for any possible type of data to be stored or retrieved (such as 'foo'), than your approach is valid!

Just think, how can I communicate best what options are available?

WARNING; shameless plug:
Your code is remarkably similar to our free tool meshydb. I would encourage you to check it out. It actually aligns well with your project.