Bird
0
0

If a GraphQL query requests only the user's ID but the client needs the user's name and email too, what will happen?

medium📝 query result Q5 of 15
GraphQL - Basics and Philosophy
If a GraphQL query requests only the user's ID but the client needs the user's name and email too, what will happen?
AThe client receives only the ID and must request again for missing data
BThe query automatically fetches missing fields
CThe server returns an error for missing fields
DThe client receives all requested and needed data
Step-by-Step Solution
Solution:
  1. Step 1: Understand requested vs needed data

    The query requests only ID, but client needs name and email too.
  2. Step 2: Identify under-fetching effect

    Client gets only ID and must send more queries to get name and email.
  3. Final Answer:

    The client receives only the ID and must request again for missing data -> Option A
  4. Quick Check:

    Missing fields = Under-fetching causes extra requests [OK]
Quick Trick: Request all needed fields to avoid multiple queries [OK]
Common Mistakes:
  • Assuming server fills missing fields automatically
  • Thinking server returns error for missing fields
  • Confusing under-fetching with over-fetching

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes