Comment by ITB
4 days ago
If a certain arrangement makes it more likely to write bad queries, and it requires extra care to write optimal queries, then it’s a worse interface to a database. I bet for really database intensive applications graphQL adds more work than it saves.
It’s not though. Especially since GraphQL makes no mention of databases. It’s a resource agnostic protocol.
This isn’t a technical issue with GraphQL. It’s a culture issue among developers who shoehorn GraphQL and don’t use it appropriately
As someone who works on very database intense application GraphQL saves me more work than its ever caused.
Any chance you can point to a good graphql implementation/framework that someone could use to learn best practices?
You're talking about the implementation of the protocol, right?
That is a good implementation of it, called GraphQL Yoga[0]
However I'm concerned there is a slight disconnect here. I'm saying that the technical specification of GraphQL does not lend itself to being bad, rather its the failure of developers to really understand its purpose and what its for (its a giant aggregator, with various ways to optimally aggregate things together, depending on what is optimal for a given problem set)
For that, I recommend becoming more familiar with the specification itself[1] because thats what I'm talking about. The specification (and thus its technical nature) doesn't prescribe anything regarding how you get data on to the graph. Many people equate GraphQL with database problems[2]
This doesn't mean I don't understand that GraphQL has shortcomings, but all approaches to APIs have short comings. I have found GraphQL has the least amount
[0]: https://github.com/dotansimha/graphql-yoga
[1]: https://spec.graphql.org
[2]: Common complaint I see all the time. I find it stems from a failure to understand how the entirety of GraphQL is meant to work, and some of the mechanics within. Like when to appropriately leverage DataLoader[3], for instance.
[3]: https://github.com/graphql/dataloader