"Cannot return null" for LabeledEvent.label and UnlabeledEvent.label


#1

I’m getting the following error response:

{
  "data": null,
  "errors": [
    {
      "message": "Cannot return null for non-nullable field LabeledEvent.label"
    },
    {
      "message": "Cannot return null for non-nullable field UnlabeledEvent.label"
    }
  ]
}

With this query:

query IssueOrPullRequest($owner: String!, $repo: String!, $number: Int!, $page_size: Int!) {
  repository(owner: $owner, name: $repo) {
    name
    issueOrPullRequest(number: $number) {
      ... on Issue {
        timeline(first: $page_size) {
          nodes {
            ... on LabeledEvent {
              label {
                color
                name
              }
            }
            ... on UnlabeledEvent {
              label {
                color
                name
              }
            }
          }
        }
      }
    }
  }
}

Using these variables:

{
  "owner": "Instagram",
  "repo": "IGListKit",
  "number": 769,
  "page_size": 100
}

This reproduces 100%.


Cannot return null for non-nullable field ReviewRequestedEvent.subject
#2

Hey @rnystrom

Can confirm! I’ve added this to our internal bug tracker - I’ll update the issue when I have more news!


#3

Hey @rnystrom!

We just shipped a bugfix for this issue, that query should now return:

{
  "data": {
    "repository": {
      "name": "IGListKit",
      "issueOrPullRequest": {
        "timeline": {
          "nodes": [
            {
              "label": {
                "color": "c2e0c6",
                "name": "oss-workshop"
              }
            },
            {},
            {},
            {
              "label": {
                "color": "c2e0c6",
                "name": "oss-workshop"
              }
            },
            {
              "label": {
                "color": "3897F0",
                "name": "enhancement"
              }
            },
            {
              "label": {
                "color": "FD8D32",
                "name": "starter-task"
              }
            },
            {}
          ]
        }
      }
    }
  }
}

If you see this again, or if anything else comes up, don’t hesitate to reach out!