Hacker News new | ask | show | jobs
by mdaniel 1424 days ago
Isn't that only true if the consumer is fluent in GraphQL syntax?

  curl https://example.com/some/endpoint?someq=yup
versus

  curl -d '{"query":"query Q { someMethod(someArg: \"someValue\") { ...ohgawd } }"}' https://example.com/graphql
even typing that out I had to carefully count back the closing braces

And, from the JS PoV, similar burden of the "interior" language

  fetch("https://example.com/graphql", {method: "POST", body: "query Q { #and the rest }"})
1 comments

True, a query is needed, but that is pretty straightforward and crucially, there are schema-aware editors that just plug in to the endpoint. Boom, autocomplete for fields and queries, and syntax validation out of the box. Indispensable piece of any GraphQL backend stack.

Besides, any sane developer will build an abstraction on top of the fetch request.

The difference to any other JSON reply is minimal.