prisma / prisma-admin-feedback

Feedback for Prisma Admin (currently in invite-only preview)
6 stars 1 forks source link

"Show error message" should show only the returned `message` of the underlying GraphQL error #77

Open nikolasburk opened 5 years ago

nikolasburk commented 5 years ago

Currently when there's an error after editing smth, e.g. adding a new record but forgetting to add required field, the error message is shown as a full-blown JSON GraphQL error:

{
  "data": null,
  "errors": [
    {
      "message": "Variable '$createUserData_0' expected value of type 'UserCreateInput!' but got: {\"name\":\"asd\"}. Reason: 'email' Expected non-null value, found null. (line 1, column 11):\nmutation ($createUserData_0: UserCreateInput!){\n          ^",
      "locations": [
        {
          "line": 1,
          "column": 11
        }
      ]
    }
  ]
}

I think it would be a lot nicer to read if only the parsed message was shown.

Maybe locations could also be added in a nicer format. The rest of the JSON feels like noise.

image