Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HasuraError extensions error messages #139

Open
aliboy-lala opened this issue Jan 14, 2025 · 0 comments
Open

HasuraError extensions error messages #139

aliboy-lala opened this issue Jan 14, 2025 · 0 comments

Comments

@aliboy-lala
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant