logoalt Hacker News

couchand • today at 11:05 AM • 1 reply • view on HN

> Well, not if there is competence

It’s not just that users are holding it wrong. It’s sold as that tool. Boosters’ main argument is how simple it is to gather all the data from many different backends without needing to understand the details.


Replies

dofm • today at 11:15 AM

It is not "sold" as that tool at all? And boosters' opinions are irrelevant, aren't they? Why are you responding to what they think? As a discipline I think it's better to describe what you yourself think is wrong with a technology, rather than conjuring up someone else's loud misunderstanding of it to critique it.

(e.g. if you want to learn local AI, the very worst way you can do it is by watching most local AI boosters on youtube!)

GraphQL is just a tool that allows you to select only what you need from a graph of data in single calls rather than chains of calls where a top-level API result has to be dereferenced into another API call.

Nowhere in its marketing (such as that exists) is anything like "one query, fired at page load, that returns a giant json blob with all the data in it".

If developers are fetching massive blobs of data at page load it's a data design problem, not a GraphQL problem, and it will be true everywhere.

Granted, if you are in that domain, you might as well have a JSON API with a couple of flags to describe what you want to expand (like e.g. the Stripe API does). Nobody is saying GraphQL is always better.

Indeed, if your data itself is specifically and inevitably a tree structure, particularly one with self-nesting entities that must always be queried from close to the root with a handful of expansions, GraphQL isn't the best choice; it doesn't give you any extra tools and its syntax might be getting in the way (it doesn't have XPath-type functionality).

But if you use it properly, you can query objects in different directions, and you get all sorts of useful stuff for free, not least type safety.

Holding it right is an unavoidable part of tech stack choice, no? No technology will prevent incompetent developers misusing it.

➕ show 1 reply