10 ms·
I can't comment on all the shortcomings and this may be reflective on my lack of experience with different implementations, but doesn't using GraphQL basically
by davzie 2y ago
I can't comment on all the shortcomings and this may be reflective on my lack of experience with different implementations, but doesn't using GraphQL basically just enable a tonne of unoptimised database queries to occur that, at scale, could cause some serious load issues?
- no_wizard 2y agoGraphQL says nothing about databases at all. Resolvers can get resources from anything, they’re agnostic. None of that is inherent to the technology but it’s a common folly among developers. This is an issue with REST too but it can be more obfuscated
- ITB 2y agoIf 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.
- no_wizard 2y agoIt’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.
- jayknight 2y agoAny chance you can point to a good graphql implementation/framework that someone could use to learn best practices?
- no_wizard 2y agoYou'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 https://github.com/dotansimha/graphql-yoga [1]: https://spec.graphql.org 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 https://github.com/graphql/dataloader
- endofreach 2y ago> GraphQL makes no mention of databases. It’s a resource agnostic protocol. So the QueryLanguage is just marketing?