Kuali GraphQL Documentation

Essentials

Errors

The GraphQL API provides a variety of errors.


Overview

At times your GraphQL queries and mutations will generate errors. Different issues can cause errors including, but not limited to, data validation errors, reference errors, authentication errors and sometimes internal server errors.

Data validation errors

If you attempt to insert an invalid data type into a field it will generate a validation error. For example, if you try to put a number into text field it will generate a form validation error.

Query

      
        mutation ($id: ID!, $data: JSON!) {
          updateDocument(args: {id: $id, data: $data}) {
            id
            data
          }
        }
      
    

Variables

      
        {
          "id": "640266d76f0562f58f9197c6",
          "data": {
            "dORA8YYBmX": 5
          }
        }
      
    

Results

      
        {
          "errors": [
            {
              "message": "Form validation failed.",
              "locations": [
                {
                  "line": 2,
                  "column": 3
                }
              ],
              "path": [
                "updateDocument"
              ]
            }
          ],
          "data": {
            "updateDocument": null
          }
        }
      
    

Reference errors

Unexpected references in your GraphQL queries will generate errors.

Query

      
        query {
          actions {
            app {
              ...AppFragment
            }
          }
        }
      
    

Results

      
        {
          "errors": [
            {
              "locations": [
                {
                  "column": 7,
                  "line": 4
                }
              ],
              "message": "Unknown fragment \"AppFragment\""
            }
          ]
        }
      
    

Authentication errors

If you don't provide a valid api key, you'll get an authentication error.

HTTP headers

      
        { "Authorization": "Bearer notarealapikey" }
      
    

Results

      
        {
          "error": {
            "message": "Unauthorized"
          }
        }
      
    

Internal server errors

We do our best to minimize this type of error, but on occasion you may encounter an error that results from something unexpected happening on our servers.

Query

      
        query ($id: ID!) {
          integration(id: $id) {
            definition
            description
            id
            name
          }
        }
      
    

Variables

      
        { "id": "6165e4b8451dbb009qwd57541b" }
      
    

Results

      
        {
          "error": [
            {
              "message": "Cast to ObjectId failed for value \"6165e4b8451dbb009qwd57541b\" (type string) at path \"_id\" for
        model \"Integration\"",
              "location": [],
              "path": ["integration"],
              "extensions": {
                "code": "INTERNAL_SERVER_ERROR",
                "exception": {
                  "stringValue": "\"6165e4b8451dbb009qwd57541b"\",
                  "kind": "ObjectId",
                  "value": "6165e4b8451dbb009qwd57541b",
                  "path": "_id",
                  "reason": {},
                  "valueType": "string",
                  "stacktrace": []
                }
              }
            }
          ],
          "data": {
            "integration": null
          }
        }