GraphQL: can't get repository by name

I can get the name for a repository

{
  "data": {
    "viewer": {
      "repositories": {
        "totalCount": 6,
        "nodes": [
          {
            "name": "jade-data-repo",
            "viewerCanAdminister": true
          }
        ]
      }
    }
  }
}

but if I try to get that repository by name, it returns null

{
  viewer {
    repository(name: "jade-data-repo") {
      viewerCanAdminister
    }
  }
}

{
  "data": {
    "viewer": {
      "repository": null
    }
  }
}

Thanks for reaching out.

When querying for a repository object, even when you specify viewer, you have to give both the name and owner of the repository you want returned. The reason for this is that I, as a viewer, may have access to both the atom/atom repository and the lee-dohm/atom repository, so specifying atom by itself is ambiguous.

I hope that helps!

1 Like

Please provide example query of how this is done