Bird
0
0

Identify the error in this mutation:

medium📝 Debug Q6 of 15
GraphQL - Mutations
Identify the error in this mutation:
mutation { addBook(title: "1984", author) { id } }
AReturn fields are not specified
BMutation keyword is missing
CMissing value for author argument
DMutation name is incorrect
Step-by-Step Solution
Solution:
  1. Step 1: Check argument syntax

    Arguments must have values; author is given without a value.
  2. Step 2: Confirm mutation structure

    Mutation keyword is present, return fields specified as id, so no error there.
  3. Final Answer:

    Missing value for author argument -> Option C
  4. Quick Check:

    Arguments need values [OK]
Quick Trick: Every argument must have a value [OK]
Common Mistakes:
  • Leaving argument without value
  • Forgetting parentheses around arguments
  • Not specifying return fields

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes