3 ms·
In my experience, GraphQL tempts one to ask for more information than necessary at the moment. That might be useful in just another click or two, but then again
by freeopinion 6y ago
In my experience, GraphQL tempts one to ask for more information than necessary at the moment. That might be useful in just another click or two, but then again, might not.
As you say, smaller, simpler queries are more performant. They also tend to be more relevant. It's kinda like the argument for 2 dozen eggs at $1.60 instead of a dozen eggs for $1. Buying 2 dozen at a time optimizes the cost per egg. But if you only ever eat 10 eggs before you throw the rest away, cost per egg is not the most important factor.
I prefer to pull data on demand in smaller chunks. At which point, GraphQL makes less sense for my use case. But I think it's cool that somebody thought it up and I'm sure it's very helpful in lots of situations.
- slifin 6y agoFulcro in the CLJS world solved this by generating the graph query based on what's currently in the component tree, if you take react components out of your view your query automatically adjusts to remove the components requirements from the graph call I imagine most js frameworks are greedy because it's extra work to be lean here