Cannot return null for non-nullable field License.body



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 {

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.



Error when trying to query nested fields of licenseInfo

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!