Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

HasuraError extensions error messages #139

@aliboy-lala

Description

@aliboy-lala

Hi, cannot get Hasura error extensions. Hasura response is as follow:

{
  "data": null,
  "errors": [
    {
      "extensions": {
        "classification": "DataFetchingException",
        "errorCode": 422,
        "errorMessages": [
          {
            "attribute": "E",
            "message": "Error message",
            "parameters": "{\"parameter\":20}"
          }
        ]
      },
      "locations": [
        {
          "column": 34,
          "line": 1
        }
      ],
      "message": "System error",
      "path": [
        "SomePath"
      ]
    }
  ]
}

and calling it as follow:

try {
     var result = await HasuraConnect(url, headers: headers)
         .mutation(document);

     return result;
   }
   on HasuraRequestError catch(e) {
     print(e.extensions?.code);

   }

But always get null. Only what I got is "System error" message. Is there way how to get to extension error messages? Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions