by HugoDaniel · 9y ago · 0 comments
Striking the middle ground there is also postgrest[0] and their queryable REST approach.
* 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.
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.