Hacker News new | past | comments | ask | show | jobs | submit login

I would agree, but would add one note at the end: "Yes you can do this with REST by including query params to reduce/tune what gets returned, but that can quickly balloon into a monster when you get beyond pagination, ?expanded=1 for full objects (vs partials/abbreviated), etc."



The same is true of GraphQL, if you want to control how much of nested objects you get (eg. introduce limits on the number of nested objects).

Basically, with GraphQL you hide all the complexity behind generic-seeming API requiring one API call, whereas with REST you'd usually hit multiple endpoints for different data types.

GraphQL has the benefit of allowing the backend to smartly decide how to restrict the data (eg. do the joins between what would have been two bigger REST queries), but that incurs a development cost. The complexity is in marrying all the familiar optimization tricks for SQL databases with exposing that in a generic but still restricted way.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: