System Design · Middle · Question 5 of 75
What is the main trade-off of GraphQL compared to REST?
- ✓Correct answer: Precise field selection, but harder caching and protection from heavy queries
- 2GraphQL is faster than REST in every scenario without exception
- 3GraphQL doesn't need a schema, so the API is easier to change
Explanation
GraphQL solves over- and under-fetching and provides a typed schema. But queries go via POST to a single endpoint, so URL-based CDN caching doesn't work out of the box; you need a normalized client cache (Apollo, urql), complexity limits and persisted queries.