D. Missing $ before variable name in mutation definition
Solution
Step 1: Check variable declaration syntax
Variables in mutation definitions must start with $, e.g., $id: ID!.
Step 2: Verify usage inside mutation
Inside the mutation body, use the variable with $id, not just id.
Final Answer:
Missing $ before variable name in mutation definition -> Option D
Quick Check:
Variables require $ prefix in definition and usage [OK]
Hint: Always prefix variables with $ in mutation definitions [OK]
Common Mistakes:
Omitting $ in variable declaration
Using variable name without $ inside mutation
Assuming mutation name must match field
5. You want to create a mutation that accepts a complex input object with fields title (String), content (String), and tags (list of Strings). Which is the correct way to define the input argument and use it in the mutation?
hard
A. type PostInput { title: String!, content: String!, tags: [String!]! } mutation createPost(post: PostInput!) { addPost(post: post) { id } }