Re:Post-REST
by cryptonector on Monday November 19, 2018 @05:32PM
(#18490330)
> Semantics of GraphQL enable a schema-dependent set of queries, not arbitrary queries.
I mean, in SQL useful queries are generally schema-dependent. Sure, you could have XPath/JSONPath/whatever extensions that allow you to query something closer to free-form documents, but your queries will still be schema-dependent in some way.
SQL schema defines data and you cannot limit which queries are available on that data, whereas GraphQL schema defines both data and which queries are available.
Maybe I'm missing something, but isn't that exactly what you can expect from a GraphQL API as a sweet spot between SQL and REST? Semantics of GraphQL enable a schema-dependent set of queries, not arbitrary queries.
> Anyhow, I see GraphQL as a convenience feature designed to make synchronous APIs run more efficiently.
For asynchronicity, GraphQL has subscriptions.
That being said, I agree GraphQL (of today at least) won't be a solution to every problem and I bet transports such as HTTP/2 and HTTP/3 will cause new things to be built which don't look like just a faster REST, GraphQL or MQTT. I would mention event sourcing and persistent logs in addition to just stream/queue processing.
Tooling (like API management gateways and API consoles) is not still all there for GraphQL and MQTT either.