graphql.js icon indicating copy to clipboard operation
graphql.js copied to clipboard

Return human-readable GraphQL errors

Open gr2m opened this issue 4 years ago • 0 comments

Follow up to https://github.com/probot/probot/issues/484

GraphQL returns great error messages:

GraphQLError: [{"message":"Resource not accessible by integration","type":"FORBIDDEN","path":["resource","author","hovercard"],"locations":[{"line":11,"column":15}]}]

We should take advantage of that and make them B-E-A-utiful!

There was an error in your GraphQL Query:

on line 11, column 15:
              ... on User {
                hovercard {
                
                ^-- FORBIDDEN: Resource not accessible by integration

I think we probably shouldn't put this into @octokit/graphql itself, but an Octokit plugin, because the JSON response message can be processed more easily by other tooling. But either way, if anyone would like to work on it, I'd be happy to collaborate

gr2m avatar Dec 08 '20 20:12 gr2m