0
0
GraphQLquery~20 mins

Error classification in GraphQL - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
GraphQL Error Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Identify the error type from GraphQL query
What error type will this GraphQL query produce when executed if the field age does not exist in the schema?
GraphQL
query {
  user(id: "123") {
    name
    age
  }
}
ASyntaxError
BValidationError
CExecutionError
DAuthenticationError
Attempts:
2 left
💡 Hint
Think about errors caused by requesting fields not defined in the schema.
Predict Output
intermediate
2:00remaining
Determine the error from a malformed GraphQL query
What error will this GraphQL query produce due to incorrect syntax?
GraphQL
query {
  user(id: "123") {
    name
    email
  
}
ASyntaxError
BTimeoutError
CExecutionError
DValidationError
Attempts:
2 left
💡 Hint
Look for missing or extra braces or parentheses.
Predict Output
advanced
2:00remaining
Identify the error when a resolver throws an exception
What error type will be returned if a resolver function throws an exception during query execution?
GraphQL
query {
  user(id: "123") {
    name
    posts {
      title
    }
  }
}
AExecutionError
BValidationError
CSyntaxError
DAuthorizationError
Attempts:
2 left
💡 Hint
Consider errors that happen while fetching data, not parsing or validating.
Predict Output
advanced
2:00remaining
Classify the error caused by unauthorized access
What error will be returned if a user tries to access a field they do not have permission to see?
GraphQL
query {
  secretData {
    confidentialInfo
  }
}
AValidationError
BAuthenticationError
CSyntaxError
DAuthorizationError
Attempts:
2 left
💡 Hint
Think about errors related to permission checks after authentication.
🧠 Conceptual
expert
3:00remaining
Distinguish error types in GraphQL lifecycle
Match each error type to the correct phase in the GraphQL request lifecycle where it typically occurs.
A1: Authorization, 2: Execution, 3: Validation, 4: Parsing
B1: Validation, 2: Parsing, 3: Authorization, 4: Execution
C1: Parsing, 2: Validation, 3: Execution, 4: Authorization
D1: Execution, 2: Authorization, 3: Parsing, 4: Validation
Attempts:
2 left
💡 Hint
Recall the order: parsing, validating, executing, then checking permissions.