"Viewer" misses repos with affilliations ORGANIZATION_MEMBER


#1

The following query shows different results for repos in orgs owned by the user when using “viewer” vs. user() for the same user. It shows 2 repos when using viewer and 4 when using user(). All the repos are public and owned by orgs owned by the same viewer/user.

In this example, it seem as if the viewer only lists the repos for the first org owned by the viewer, but in a more complex queries I tried, the results included 2 orgs and missed a third one.

The query was posted using oauth authentication.

Any reason for the different behavior? Thanks.

EXAMPLE QUERY

query {
  viewer {
    login
    as_viewer:repositories(first:100,affiliations:[ORGANIZATION_MEMBER]) { nodes{name} }
  }
  user(login:"macp3o") {
    login
    as_user:repositories(first:100,affiliations:[ORGANIZATION_MEMBER]) { nodes{name} }
  }
}

RESPONSE – note 2 repos vs. 4 for the same login in a single query

{
   "data": {
      "viewer": {
         "login": "macp3o",
         "as_viewer": { "nodes": [
            { "name": "inkitiki.com" },
            { "name": "tv" }
         ] }
},
"user": {
   "login": "macp3o",
      "as_user": { "nodes": [
         { "name": "inkitiki.com" },
         { "name": "storynomy.com" },
         { "name": "tv" },
         { "name": "media-assets" }
     ] }
    }
 }

}


#2

Hi @macp3o, thanks for reporting this discrepancy! Let me take a look at why this is and get back to you …