Bird
0
0

Which of the following is the correct syntax to start a mutation operation in GraphQL?

easy📝 Syntax Q3 of 15
GraphQL - Mutations
Which of the following is the correct syntax to start a mutation operation in GraphQL?
Aquery { updateUser(id: 1) { name } }
Bmutation { updateUser(id: 1) { name } }
Cmutate { updateUser(id: 1) { name } }
Dchange { updateUser(id: 1) { name } }
Step-by-Step Solution
Solution:
  1. Step 1: Identify the keyword for mutation

    The correct keyword to start a mutation is 'mutation'.
  2. Step 2: Check the options

    Only mutation { updateUser(id: 1) { name } } uses 'mutation' correctly; others use wrong keywords.
  3. Final Answer:

    mutation { updateUser(id: 1) { name } } -> Option B
  4. Quick Check:

    Mutation keyword = mutation [OK]
Quick Trick: Start mutations with 'mutation' keyword [OK]
Common Mistakes:
  • Using 'query' instead of 'mutation'
  • Using non-existent keywords like 'mutate' or 'change'
  • Omitting the mutation keyword

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes