Bird
0
0

You want to test a mutation in GraphQL Playground to add a new user with name and email. Which of these is the correct mutation syntax?

hard📝 Application Q8 of 15
GraphQL - Basics and Philosophy
You want to test a mutation in GraphQL Playground to add a new user with name and email. Which of these is the correct mutation syntax?
Amutation addUser { name: "Alice", email: "alice@example.com" }
BaddUser(name: "Alice", email: "alice@example.com") { id name email }
Cmutation { addUser(name: "Alice", email: "alice@example.com") { id name email } }
Dmutation { addUser { name: "Alice", email: "alice@example.com" } }
Step-by-Step Solution
Solution:
  1. Step 1: Understand mutation syntax

    Mutations start with 'mutation' keyword and call mutation field with arguments inside parentheses.
  2. Step 2: Identify correct argument placement and response fields

    mutation { addUser(name: "Alice", email: "alice@example.com") { id name email } } correctly passes arguments and requests returned fields inside braces.
  3. Final Answer:

    mutation { addUser(name: "Alice", email: "alice@example.com") { id name email } } -> Option C
  4. Quick Check:

    Mutation syntax = Correct argument and field structure [OK]
Quick Trick: Mutations use 'mutation' keyword and pass arguments in parentheses [OK]
Common Mistakes:
  • Omitting 'mutation' keyword
  • Placing arguments outside parentheses
  • Not requesting return fields

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes