Bird
0
0

Find the mistake in this delete mutation:

medium📝 Debug Q7 of 15
GraphQL - Mutations

Find the mistake in this delete mutation:
mutation { deletePost(postId: "abc") { success message } }
Server returns error: Field 'message' not found on type 'DeletePostResponse'

AThe field 'message' does not exist in the response type
BpostId should be an integer, not string
CMutation keyword is missing
DThe mutation name is incorrect
Step-by-Step Solution
Solution:
  1. Step 1: Analyze server error message

    The error says 'message' field is not found on the response type.
  2. Step 2: Confirm mutation syntax is correct

    Mutation keyword and argument type are correct, so the problem is the requested field.
  3. Final Answer:

    The field 'message' does not exist in the response type -> Option A
  4. Quick Check:

    Request only valid fields in mutation response [OK]
Quick Trick: Request only fields defined in mutation response type [OK]
Common Mistakes:
  • Requesting non-existent fields
  • Assuming argument type errors from field errors
  • Ignoring server error details

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes