midAPI Design
REST vs. GraphQL: When to use which?
Updated Apr 28, 2026
Short answer
REST is resource-based and uses standard verbs; GraphQL is query-based and allows clients to request specific data.
Deep explanation
Intermediate API design involves handling complexity and security. REST is resource-based and uses standard verbs; GraphQL is query-based and allows clients to request specific data.
Real-world example
GitHub API using cursors for navigating large lists of commits.
Common mistakes
- Not versioning the API from day one, leading to breaking changes.
Follow-up questions
- Is PUT idempotent?
- Is POST idempotent?