Query repository: invalid name


#1

When querying a repository. If I pass an invalid owner I get an entry in errors of type NOT_FOUND.
But with a valid owner and invalid name I get no error at all and a null repository data.
I would expect to also get a NOT_FOUND error.

query FindRepoID {
 repository(owner:"octocat", name:"invalid") {
    id
 }
}

#2

Great catch, @schettino72, this is an oversight on our part. I’ve added an internal issue to unify the way that these results are structured when something can’t be found. Thank you.


#3

Hey @schettino72!

We just shipped an update to fix this particular (repository) issue:

query FindRepoID {
 repository(owner:"octocat", name:"invalid") {
    id
 }
}

Will now return

{
  "data": {
    "repository": null
  },
  "errors": [
    {
      "message": "Could not resolve to a Repository with the name 'invalid'.",
      "type": "NOT_FOUND",
      "path": [
        "repository"
      ],
      "locations": [
        {
          "line": 2,
          "column": 2
        }
      ]
    }
  ]
}

If you see further inconsistencies like this, don’t hesitate to reach out on this thread, or in a new one!


#4

Hi Nick,

Great. I tested and it now works as expected. thanks!

Is this error format documented anywhere?
I saw no reference in the docs API. In the explorer docs/schema seems that the error schema is not included.