Bird
0
0

Find the mistake in this mutation using input type:

medium📝 Debug Q7 of 15
GraphQL - Schema Definition Language (SDL)
Find the mistake in this mutation using input type:
mutation updateUser($data: UserInput!) { updateUser(data) { id name } }
AInput types cannot be used in mutations
BThe variable declaration is missing the exclamation mark
CThe argument 'data' must be passed as 'data: $data' inside the mutation body
DThe mutation name must be 'updateUserMutation'
Step-by-Step Solution
Solution:
  1. Step 1: Check variable usage in mutation body

    Variables must be passed as named arguments with colon, e.g. data: $data.
  2. Step 2: Verify other options

    Variable declaration has exclamation mark, input types are valid in mutations, mutation name can be arbitrary.
  3. Final Answer:

    The argument 'data' must be passed as 'data: $data' inside the mutation body -> Option C
  4. Quick Check:

    Pass variables as named args with colon [OK]
Quick Trick: Use 'argName: $variable' syntax in mutation body [OK]
Common Mistakes:
  • Passing variable without argument name
  • Omitting colon between argument and variable
  • Thinking mutation names must follow strict patterns

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes