Bird
0
0

How would you combine REST and GraphQL to optimize an existing API system?

hard📝 Application Q9 of 15
Rest API - REST API Fundamentals
How would you combine REST and GraphQL to optimize an existing API system?
AUse REST for simple resource retrieval and GraphQL for complex queries needing multiple resources
BReplace all REST endpoints with SOAP services
CUse GraphQL only for authentication and REST for data fetching
DUse REST for mutations and GraphQL for static content delivery
Step-by-Step Solution
Solution:
  1. Step 1: Understand strengths of REST and GraphQL

    REST is simple and efficient for straightforward resource access. GraphQL excels at complex queries involving multiple resources.
  2. Step 2: Apply combined approach

    Using REST for simple calls and GraphQL for complex queries optimizes performance and flexibility.
  3. Final Answer:

    Use REST for simple resource retrieval and GraphQL for complex queries needing multiple resources -> Option A
  4. Quick Check:

    Combine REST and GraphQL by task complexity [OK]
Quick Trick: Use REST for simple, GraphQL for complex queries [OK]
Common Mistakes:
  • Replacing REST with SOAP unnecessarily
  • Misusing GraphQL for authentication only
  • Confusing roles of REST and GraphQL

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes