Skip to content

Return human-readable GraphQL errors #239

Open
@gr2m

Description

@gr2m

Follow up to probot/probot#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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Up for grabsIssues that are ready to be worked on by anyoneType: FeatureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions