Re:Kick Start a JavaScript GraphQL API with Apollo-Server, D...
by adamors on Wednesday August 23, 2017 @09:06AM
(#15081178)
GraphQL adds:
* living documentation
* much better approach to versioning/deprecation
* type system
etc.For REST based APIs you have to figure out all of these (and usually they are completely different accross projects/languages etc.).
Solutions like Swagger offer some sort of solution but they are still a PIA to work with.
Re:Kick Start a JavaScript GraphQL API with Apollo-Server, D...
by strken on Wednesday August 23, 2017 @09:01AM
(#15081147)
This may be controversial, but I don't think REST is significantly simpler when implemented in a real project.
The setup for GraphQL takes longer than for REST because the ecosystem is still much younger, meaning you have to write some abstractions and helpers yourself. Once that's done, however, adding new types and new actions/mutations is about as hard in each and takes roughly the same amount of code. However, in GraphQL the maintenance cost from "hey, can you add X to the Y endpoint?" is dramatically reduced, and Apollo can save you from a lot of bugs by validating queries against the schema at compile time.
Striking the middle ground there is also postgrest[0] and their queryable REST approach.
[0] https://postgrest.com/en/v4.1/