| > This is nonsense. GraphQL queries are simple HTTP requests, with no more complexity than REST. You POST a query string and some JSON The complexity of GraphQL in fact begins there, and also sort of explains a lot of why GraphQL is all but simple:
Why am I using a query language instead of just passing an AST via JSON, a data format every general purpose language supports very well these days? The answer to the above question, and most of GraphQLs other complexities: Some arbitrary design decision. Another example:
GraphQL could've easily been expressed as a REST API, even an Open API. From what I have seen, with the help of VC backing and FAANG endorsement, GraphQL mostly rose to replace JSON:API, which accomplishes pretty much all of the same goals in just JSON (and is RESTful). One big issue of GraphQL is also that API clients tend to suck. That's not a problem for OpenAPIs. And again, why is this the case? Some arbitrary design decision. I feel like in general, someone creating a new DSL where it's not needed (and is obviously designed to look cool rather than actually be expressive), is a good sign they're just writing the software to stroke their ego rather than reach a meaningful end. That's why in all the promo material for GraphQL you only see the query language, and not all of the actual setup required to send a request or even what an actual GraphQL HTTP request looks like. GraphQL, the framework, is not actually as simple and elegant as GraphQL the query language attempts to portray it as. It's almost like someone came up with a query language for fun then came up with all the details of how a web server would utilize it afterwards. Even today, GraphQL markets itself only as a query language (A query language for your API). When, as you have already mentioned, it is more than that. That's why most developers know vaguely what GraphQL is ("Oh, that one language") but not how it actually works in practice. And when they actually encounter it, it feels almost like a betrayal, because it's nowhere near as simple, sleek or elegant as all the marketing they saw suggested. At least, this was my experience when having to deal with a
third party GraphQL API (funny enough, they migrated from REST, see ShipHero). |