Thanks to visit codestin.com
Credit goes to github.com

Skip to content

GraphQL errors can contain ints as well as strings #4117

@maxbeizer

Description

@maxbeizer

Describe the bug

When hitting an unrelated error, I see the following:

$ gh pr view
json: cannot unmarshal number into Go struct field GraphQLError.Errors.Path of type string

So as @vilmibm points out, looks like the return type can be a number as well as a string.

 $ gh --version
gh version 1.13.1 (2021-07-20)
https://github.com/cli/cli/releases/tag/v1.13.1

Steps to reproduce the behavior

  1. Set the token permissions to not include projects scopes
  2. try to view a pr associated with a project
  3. See error

Expected vs actual behavior

Even if it does error out based on permissions, I expect it not the send me Golang errors.

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions