Exceptions

Now, we have successfully made our first query and seen a structured response. However, there are often cases of exceptions. These exceptions arise from incorrect params, arguments or fields passed in the Query request body.

  1. Invalid boardId (invalid argument).
    status: 200OK
{
   "errors": [
       {
           "message": "Invalid board ID: 614b55ad1ebfa11fca5dab70",
           "locations": []
       }
   ],
   "data": {
       "fields": null
   }
}
  1. Invalid property in payload
    status: 200OK
{
   "errors": [
       {
           "message": "{minDate=2021-09-29, field=typeData, hint=dates, maxDate=2021-10-07, message=Unsupported property present in payload, rejectedValue=placeholder, required=true, status=FAILED_VALIDATION, multi=true}",
           "locations": []
       }
   ],
   "data": {
       "fields": null
   }
}
  1. Field not present in Parent board
    status:200Ok
{
    "errors": [
        {
            "message": "Validation error of type WrongType: argument 'createBoardDTO.duplicateInfo' with value 'ObjectValue{objectFields=[ObjectField{name='name', value=StringValue{value='Example Board1'}}, ObjectField{name='description', value=StringValue{value='This is an example board'}}, ObjectField{name='size', value=EnumValue{name='SMALL'}}, ObjectField{name='icon', value=StringValue{value='uil-apps'}}, ObjectField{name='colour', value=StringValue{value='#ffb703'}}, ObjectField{name='parentBoard', value=StringValue{value='60fae4ec9fa6e1b9e44dfbf6'}}, ObjectField{name='duplicateInfo', value=ObjectValue{objectFields=[ObjectField{name='readOnly', value=BooleanValue{value=true}}]}}]}' contains a field not in 'DuplicateInfo': 'readOnly' @ 'board'",
            "locations": []
        }
    ],
    "data": null
}
  1. Wrong value type
    This exception occurs for wrong data type supplied. For example, using string value in place of enum value.
    status : 200Ok
{
    "errors": [
        {
            "message": "Validation error of type WrongType: argument 'createBoardDTO.size' with value 'StringValue{value='medium'}' is not a valid 'BoardSize' - Expected AST type 'EnumValue' but was 'StringValue'. @ 'board'",
            "locations": []
        }
    ],
    "data": null
}