Kick Start a JavaScript GraphQL API with Apollo-Server, Dataloader and Knex
bamtech.gitbooks.io
bamtech.gitbooks.io
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.
[1] - https://github.com/graphql/graphql-js/blob/master/PATENTS
Let's assume Facebook has patents on the ideas behind GraphQL. I don't know whether they do (and in all honesty I can't be bothered to find out, because patents are written by misanthropes).
This means that if you use GraphQL but not any Facebook-provided source, they don't promise to not use these against you. They could sue you into oblivion any time, for any reason. But if you do use Facebook code, then you got a patent grant, so you're good. Until you sue Facebook for infringing on your own patents of course - in that case, you're back to the situation where you used non-Facebook GraphQL implementations. 1)
That said, I think this is all void in reality, given that very little about the ideas behind GraphQL is new (eg check out Microsoft's OData - nearly the same thing except done by people who tuck their shirts into their jeans instead of people with hoodies and hairdos). You'd probably be able to prove prior art.
1) The same thing holds about React btw. I'm pretty convinced that any patent that could cover React also covers Preact and Inferno. If they have such a patent, they can use it against you any time. Except if you use React! In that case, you got a patent grant and they can only use it against you once you sue them first. So if you're worried about patents and think Facebook might grow a patent troll department (hey, who knows), using React is safer than Preact or any other pretty-close React clone.
Are WebComponents a thing yet? It might be better to stick to the standards and polyfills at this point.