Cannot return null for non-nullable field License.body


#1

Hello,

I’m am getting this error when trying to fetch license info using the GraphQL API on certain repositories.

Here is the query:

query {
  repository(owner: "rubyisbeautiful" name: "comatose") {
    licenseInfo {
      body
    }
  }
}

And the response is:

{
  "data": {
    "repository": {
      "licenseInfo": null
    }
  },
  "errors": [
    {
      "message": "Cannot return null for non-nullable field License.body"
    }
  ]
}

This is quite similar to this old issue. My hunch is that the data schema makes the body of license non-nullable whereas it is nullable in some instances.

Cheers,

Matt


Error when trying to query nested fields of licenseInfo
#2

Hi @matthieualouis, this seems like a bug on our end. We’ve opened an issue and tagged the folks who deal with licenses.

Thanks for reporting it!