REST vs GraphQL.
A fixed menu where each dish is a separate order, versus telling the kitchen exactly what you want on one plate.
- One menu, fixed dishes.1
REST is a fixed menu: each dish lives at its own address — /users, /orders.
- Three orders, three trips.2
Want three dishes? You place three separate orders and wait for three trips.
- I only needed the name.3
And each plate arrives whole, even when you only wanted a corner of it.
- Just these, please.4
GraphQL hands you one order window: write down exactly the fields you want.
- One plate, exactly right.5
It all comes back on a single plate, nested data and all, in one round trip.
- Can’t cache a custom plate.6
The catch: every order is bespoke, so the easy caching REST relies on stops working.
Semicolony semicolony.dev/eli5/rest-vs-graphql/comic