Live data from Hacker News

GraphQL vs. REST APIs: a complete guide

airplane.dev

1–10 of 103 posts

Re: GraphQL vs. REST APIs: a complete guide

#5
imma let u finish, but a hypermedia is a necessary constraint for an API to be RESTful...

edit: more usefully, you need to be really careful w/ your GraphQL end points because they are being access in an untrusted computing environment:

https://intercoolerjs.org/2016/02/17/api-churn-vs-security.h...

my understanding is that facebook whitelists their graphql queries but, last I looked, I didn't see security getting much attention around it...

Re: GraphQL vs. REST APIs: a complete guide

#9
Here's how you do it:

- REST/Hypermedia when you're actually building a website (not app) and your "site" is a state machine

- OpenAPI when you expose and API to 3rd parties

- Isomorphic TypeScript APIs when you're using TS on both backend and frontend [0]

- GraphQL when the frontend needs to talk to an API layer provided by different teams

- OpenAPI when one backend talks to another backend

- gRPC might be an option, but most teams don't need it

[0]: https://wundergraph.com/blog/isomorphic_typescript_apis_end_...

Re: GraphQL vs. REST APIs: a complete guide

#10

Here's how you do it: - REST/Hypermedia when you're actually building a website (not app) and your "site" is a state machine - OpenAPI when you expose and API to 3rd parties - Isomorphic TypeScript APIs when you're using TS on both backend and frontend [0] - GraphQL when the frontend needs to talk to an API layer provided by different teams - OpenAPI when one backend talks to another backend - gRPC might be an option…

[deleted]
Post reply on HN