|
|
|
|
|
by hderms
1512 days ago
|
|
In my relatively naive opinion, graphql exists to solve a few things (which are mostly benefits for large scale companies): 1. Reduce the total number of HTTP connections required to get the data for a specific component or page. Imo this is presumably less important with http3 but the driving force is probably similar for both. 2. Give backend-for-frontend style services more autonomy to provide an interface that works for a specific feature on the front end without coupling it to specifics of how the backend organizes resources 3. Allow performance issues with frontend query logic to be addressed without changing anything on the front end I think the situations where it would be useful are large teams that want to operate more independently where the overhead of dealing with graphql is worth it. An example being someone trying to render a component for a list of comments. It would be great if the front end could just write some "magic" query that gives them everything they want and they don't have to worry about batching requests to specific endpoints and the order in which they should make those requests. That doesn't mean the problem magically goes away, but it's now someone else's problem and that's good: the app development can free itself from things it shouldn't care about. |
|