A GraphQL query or mutation may result in an error response. This page explains what those errors mean.
Query errors are typically returned inside the QueryError
objects. For example:
1 2query getWorkspace($workspaceAri: ID!) { shepherd { workspace(id: $workspaceAri) { ... on QueryError { message extensions { errorType ... on ShepherdGenericQueryErrorExtension { statusCode type } } } } } }
Sample response:
1 2{ "data": { "shepherd": { "workspace": { "__typename": "QueryError", "message": "Workspace with id '84d8e33f-139b-4ca4-b5cd-586a5d858a2f' not found or not enabled", "extensions": [ { "errorType": "NO_PRODUCT_ACCESS", "statusCode": 403, "type": "NO_PRODUCT_ACCESS" } ] } } } }
Mutation errors are typically found in mutation payload objects. For example:
1 2mutation updateAlert($alertAri: ID!, $status: ShepherdAlertStatus) { shepherd { updateAlert(id: $alertAri, input:{ status: $status }) { success node { id title status } errors { message extensions { ... on ShepherdGenericMutationErrorExtension { statusCode type } } } } } }
Sample response:
1 2{ "data": { "shepherd": { "updateAlert": { "success": false, "node": null, "errors": [ { "message": "alert 67f59a35802a76b6d5911a732 not found", "extensions": { "statusCode": 400, "type": "BAD_REQUEST" } } ] } } } }
An invalid query or mutation will also result in a payload containing the error, but in a slightly different format:
1 2{ "errors": [ { "message": "Variable 'status' has an invalid value: Invalid input for enum 'ShepherdAlertStatus'. No value found for name 'IN_PROGRESS2'", "locations": [ { "column": 32, "line": 1 } ], "extensions": { "classification": "ValidationError", "errorSource": "GRAPHQL_GATEWAY", "statusCode": 400 } } ] }
Guard Detect returns the following error types to indicate specific problems:
Error type | Description | Recommended Action |
---|---|---|
BAD_REQUEST | Indicates user input errors. For example, an input value would fail validation if a string argument is shorter than the expected minimum length. Note this is not related to GraphQL validation. | Check your GraphQL query is valid and your variables are correct. |
INTERNAL_SERVER_ERROR | An unexpected error. | Check your GraphQL query is valid and your variables are correct. |
NO_PRODUCT_ACCESS | Indicates the Guard Detect workspace is not accessible; for instance, it may be disabled if the product is not active in the organization. | Contact your administrator to make sure that your organziation has a Guard Premium subscription. |
UNAUTHORIZED | Indicates the user cannot access or modify the resource indicated in the query. | Check your query arguments are correct. Contact your administrator to make sure that you have access to Guard Detect. |
Rate this page: