Bird
0
0

How can using GraphQL fragments help reduce over-fetching and under-fetching problems?

hard📝 Application Q9 of 15
GraphQL - Basics and Philosophy
How can using GraphQL fragments help reduce over-fetching and under-fetching problems?
ABy automatically fetching all fields from the server
BBy reusing field selections to keep queries consistent and precise
CBy preventing any nested queries
DBy forcing the client to request all fields every time
Step-by-Step Solution
Solution:
  1. Step 1: Understand fragments purpose

    Fragments allow reusing sets of fields in multiple queries.
  2. Step 2: Connect fragments to fetching problems

    Reusing precise field sets helps keep queries consistent and avoid extra or missing fields.
  3. Final Answer:

    By reusing field selections to keep queries consistent and precise -> Option B
  4. Quick Check:

    Fragments = Consistent, precise queries [OK]
Quick Trick: Fragments help reuse exact fields, avoiding fetch problems [OK]
Common Mistakes:
  • Thinking fragments fetch all fields automatically
  • Believing fragments prevent nested queries
  • Assuming fragments force all fields to be requested

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes