API Testing / Quiz
GraphQL Queries and Mutations, Tested
Variables, non-null bubbling, mutation side effects, aliases, and introspection, the mechanics of testing a schema-first API.
- Difficulty
- Medium
- Format
- Quiz
- Points
- 150
- Estimate
- 9 min
// MISSION BRIEF
Your Mission
GraphQL puts the query shape in the client's hands and the errors in a JSON array. This quiz is about the testing mechanics that follow: parameterizing with variables, asserting on mutation side effects, non-null failures, and the introspection endpoint you forgot to lock down.
// FIRST CONTACT
Battle teaser
A mutation returns HTTP 200 with data: { updateUser: null } and an errors entry. The correct assertion:
- ARetry until data is non-null
- BIgnore errors, GraphQL always returns them
- CTreat it as success because the status is 200
- DCheck the errors array and confirm no partial side effect persisted; null data plus errors means the mutation failed
Answers, scoring, hints, and the full battle stay sealed.
// SKILL TAGS
apigraphqlmutationsschema