Ask HN: For a greenfield public API which to use: REST, GraphQL, other? Why?

6 points by davidwells ↗ HN
Context: This product is building built with the idea in mind that other developers will build new and interesting things with the API exposed to them

5 comments

[ 0.18 ms ] story [ 28.4 ms ] thread
Depends on your use case.

GraphQL is designed for the use case of a client talking over a thin long pipe that needs to talk to many APIs. As in, it's designed for API clients that are smartphones.

And there are patent licensing issues with GraphQL.

Definitely GraphQL. Github, Shopify, Yelp and many more are now using GraphQL as their primary public API.
Do you any any examples of a company having ONLY a graphQL API for public use?
It would help us answer the question if you told us more about your application.
You can use Introspected REST (https://introspected.rest) that allows you to fine-tune and balance between REST and GraphQL. No available libraries at the moment that can help you though so this could be a problem for your use case ;)