Quote:
Originally Posted by PJo336
skeptical of what in particular? I have some issues, but in general feel quite positive about it
I guess I'd start here:
https://blog.goodapi.co/rest-vs-grap...w-5f77392658e7
I don't really agree with everything this guy says, like I don't think "true REST APIs" are that rare or complicated, but I've been doing this a really long time and maybe I'm underestimating how hard it is to get started.
The downsides of GraphQL that he brings up are huge things to me, i.e. scalability, performance, distributed-ness. The upsides are that it's "easy" which I don't care about and that it's "consistent" which I do.
However, when someone comes up with a scheme to help with consistency what they are usually leading you to is something with drastically reduced choice. The best way to make a language-type thing that leads to consistent client-server interaction is to limit the things you can do. SOAP, which he alludes to in his talk, is sort of an example of this. With SOAP, once you consume a WSDL description of a SOAP api, you can make a full client for it. That client is either going to be
* easy and consistent
* ****ing convoluted and tortured
pick one.
These automated systems in the past have led to vast abuses. I know way more about SOAP than GraphQL but it sort of leads to the same smell for me. The biggest abuse is that a lot of these systems allow turnkey ways to turn your Java or whatever library directly into an API, in the worst way possible. It reminds me of, god what was it, the tool everyone used to automate making library interfaces from C libraries to everything else (tcl, python, perl, etc).
SWIG, that's what it was. The guarantee was if you can get it to compile you'll have a library for your language that works and interfaces with the C library you wanted to target. But the only guarantee is that it will "work." It won't have any of the smoothness that comes with a library that was made by someone specifically for your language. The idioms with be the idiom of C. Type conversion will be done in the most pedantic and block headed way possible. Instead of wrestling with making a language specific library, they'll automate that part for you and instead you'll wrestle with the library itself. But writing a library is a one time pain, and using it is a forever pain. If all you need is a one-off simple interaction with the library, this is usually with it. If you want to do real work, it isn't.
All the above is really a criticism of all the things "like" graphql that I've dealt with in the last 20 years, plus what I've read about it. I haven't tried anything outside of toy systems with it myself.