4 ms·
The sibling comments here are weird to me. IME the primary reason to us GraphQL is explicitly solve the dilemma of "ReST-ful" endpoints: 1) An endpoint returns
by akavi 3y ago
The sibling comments here are weird to me. IME the primary reason to us GraphQL is explicitly solve the dilemma of "ReST-ful" endpoints:
1) An endpoint returns a superset of the data any client may need, which means more data is loaded than any given client needs (which means wasted bandwidth/compute)
2) An endpoint returns a subset of the data all clients need, which means any given client has to tack on additional queries to get everything it needs (which means more roundtrips)
(There's the third option of tacking on "includes" or "excludes" parameters to endpoints, but at that point you're evolving an ad hoc, informally-specified, bug-ridden implementation of half of GraphQL, to massacre Greenspun's tenth rule).
How important solving this dilemma is to your application may be a function of your team or system topology, and the type safety that GraphQL happens to come with is a nice bonus, but this dilemma is the crux of things.