Bird
0
0

Consider this mutation:

medium📝 query result Q4 of 15
GraphQL - Mutations
Consider this mutation:
mutation { updateArticle(id: "7", input: {content: "Updated content"}) { id content publishedAt } }

Which fields will the server return after a successful update?
Aid, content
Bid, content, publishedAt
Ccontent, publishedAt
Did only
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the mutation selection set

    The mutation requests the fields id, content, and publishedAt in the response.
  2. Step 2: Understand GraphQL response behavior

    GraphQL returns exactly the fields requested in the mutation's selection set after a successful update.
  3. Final Answer:

    id, content, publishedAt -> Option B
  4. Quick Check:

    Requested fields match returned fields [OK]
Quick Trick: Returned fields match requested selection set [OK]
Common Mistakes:
  • Assuming all fields of the object are returned by default
  • Ignoring the selection set and expecting only updated fields
  • Confusing input fields with returned fields

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes