Bird
0
0

What is a key advantage of GraphQL compared to REST when fetching data?

easy📝 Conceptual Q11 of 15
GraphQL - Basics and Philosophy
What is a key advantage of GraphQL compared to REST when fetching data?
AGraphQL does not support querying nested data.
BGraphQL requires multiple URLs for different data resources.
CGraphQL uses fixed data shapes for each resource.
DGraphQL allows fetching exactly the data you want in a single request.
Step-by-Step Solution
Solution:
  1. Step 1: Understand GraphQL data fetching

    GraphQL lets clients specify exactly what data they want in one request, avoiding over-fetching or under-fetching.
  2. Step 2: Compare with REST approach

    REST typically requires multiple URLs and fixed data shapes, which can lead to multiple requests or extra data.
  3. Final Answer:

    GraphQL allows fetching exactly the data you want in a single request. -> Option D
  4. Quick Check:

    GraphQL = precise single-request data fetching [OK]
Quick Trick: GraphQL = one request, exact data [OK]
Common Mistakes:
  • Thinking GraphQL needs multiple URLs
  • Believing GraphQL returns fixed data shapes
  • Assuming GraphQL can't query nested data

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes