REST vs GraphQL
ELI5 — The Vibe Check
REST gives you fixed endpoints that return fixed data shapes. GraphQL gives you one endpoint where you ask for exactly what you need. REST is like a set menu — you get what they serve. GraphQL is like a buffet — you pick exactly what you want. Both are valid, neither is universally better.
Real Talk
REST and GraphQL are different API paradigms. REST uses multiple URL endpoints with fixed response structures, HTTP method semantics, and HTTP caching. GraphQL uses a single endpoint with client-specified queries, avoiding over/under-fetching. REST excels at caching, simplicity, and file transfers. GraphQL excels at complex data requirements, multiple frontends, and reducing API calls.
When You'll Hear This
"We use REST for simple CRUD and GraphQL for the complex dashboard with nested data." / "GraphQL solved our over-fetching problem — mobile gets exactly the fields it needs."
Related Terms
API (Application Programming Interface)
An API is like a menu at a restaurant. The kitchen (server) can do a bunch of things, but you can only order what's on the menu.
GraphQL
GraphQL is like ordering food where YOU specify exactly what you want on your plate.
REST (Representational State Transfer)
REST is a set of rules for how APIs should behave. Think of it as the etiquette guide for servers and clients talking to each other.
tRPC
tRPC lets your frontend import and call backend functions with full TypeScript autocomplete — no REST endpoints, no OpenAPI spec, no code gen.