Choose based on who consumes the API and how varied their data needs are — not on hype. GraphQL wins when many diverse clients need to shape their own data; REST wins when requests are uniform, cacheable, and simple.
Choose based on who consumes the API and how varied their data needs are — not on hype. GraphQL wins when many diverse clients need to shape their own data; REST wins when requests are uniform, cacheable, and simple.
user -> posts -> comments) instead of N REST round trips.GET model caches trivially at every layer; GraphQL needs persisted queries to get close.| Concern | GraphQL | REST |
|---|---|---|
| Over/under-fetching | Solved by design | Common problem |
| HTTP/CDN caching | Hard (needs work) | Native and easy |
| Query-cost/DoS control | You must add it | Naturally bounded |
| Client flexibility | High | Low |
| Server complexity | Higher | Lower |
They also aren't exclusive — many systems expose REST for public/cacheable endpoints and GraphQL for rich internal clients.
Senior interviewers are testing judgment, not allegiance. The strong answer names the axes — client diversity, caching needs, team maturity, DoS surface — and admits GraphQL's real costs (caching and query-cost control) rather than selling it as universally better.
A library of IT interview questions with detailed answers — from Junior to Senior.
Donate