4 ms·
> GraphQL offers a way to push all of the logic for specifying data requirements onto the client, and in return, the server will execute the (highly structured)
by pier25 8y ago
> GraphQL offers a way to push all of the logic for specifying data requirements onto the client, and in return, the server will execute the (highly structured) data query against a known schema. The end result is a vastly simplified backend that also empowers the client to execute whichever queries they need.
Why is empowering the client a good thing?
Why is moving complexity from the backend to the front end a good thing?
- williamdclt 8y agobecause the client knows exactly what it needs and it makes abstracting the data-fetching pretty easy
- kbutler 8y agoBecause you can have one server efficiently servicing multiple clients with different, unanticipated needs.
- pier25 8y agoSo, reducing server load? OTOH if the complexity is offset to the client, and you have multiple clients, then there is more complexity. No? (assuming you have multiples types of clients)
- kbutler 8y agoIt allows a server produced by one organization to provide an API that remains efficient for future clients produced by other organizations without either changing the API to meet the needs of the other clients or anticipating every client's needs. More to be economical in API design, rather than just server load and bandwidth.
- sken 8y agoBut the client already had to consider what data it needed. The only difference is that in a REST world it needed to make several calls to fetch all the data (often waiting for resource references in the nth response before being able to build the (n+1)th query) whereas now it can fetch them all in a single query. So if anything it reduces the client complexity, as well as making it much easier to extend the API to support new client requirements without having to resort to REST-style versioning.