Bird
0
0

Identify the error in this mutation:

medium📝 Debug Q14 of 15
GraphQL - Mutations
Identify the error in this mutation:
mutation {
  updateUser(id: 5, name: "Bob")
}
AMissing requested return fields after mutation call
BWrong keyword, should be 'query' instead of 'mutation'
CMutation name 'updateUser' is invalid
DExtra parentheses around arguments
Step-by-Step Solution
Solution:
  1. Step 1: Check mutation syntax

    Mutation calls must specify which fields to return inside braces after the call.
  2. Step 2: Identify missing return fields

    This mutation lacks braces with requested fields after updateUser, causing syntax error.
  3. Final Answer:

    Missing requested return fields after mutation call -> Option A
  4. Quick Check:

    Mutations must request return fields [OK]
Quick Trick: Always request fields after mutation call in braces [OK]
Common Mistakes:
  • Omitting return fields
  • Using 'query' keyword for mutations
  • Misplacing parentheses

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes