GraphQL API v4 are not able to fetch private repositories inside organizations

Hi,
As the title says, GraphQL APIs are not able to fetch private repositories inside organizations.
I don’t know if this is intended with new APIs, but with REST one I could.
I don’t think my query is wrong, but anyway, here it is:

'{user(login: "%s"){repositories(ownerAffiliations:%s, first:%s, orderBy: {field: NAME, direction: ASC}){ nodes { diskUsage name owner { login } description url isFork isPrivate forkCount stargazerCount isInOrganization collaborators(affiliation: DIRECT, first: 100) { nodes {login name avatarUrl} } mentionableUsers(first: 100){ nodes{ login name avatarUrl } } defaultBranchRef { name } refs(refPrefix: "refs/heads/", first: 100){ nodes{ name target { ... on Commit { oid tree { oid } zipballUrl tarballUrl } } } } } } } }'

("%s" is replaced by users’ info in code)

I am the owner of 2 organizations, and member of another 2. In one of them there is only one repository (non-empty) and it is private. I cannot see this one repository.

The token I’m using has full permissions, and the organization in question doesn’t have specific privacy settings.

@fenix-hub you have a first:%s in your query the first argument should be an integer, which looks odd
You can probably debug your query by simplifying your query to ita simplear form listing of all repositories and their name ainky if it then give you want you want, add back in the additional fields and filtering you explicitly require.

Hi @byrneh ,
Thank you very much for answering.
Don’t worry about the %s, the language I’m using properly substitues all string placeholders with int, so the query works.
Anyway, I followed your suggestion, and here it is a simplified query:

query {
 viewer {
  repositories(ownerAffiliations:[ORGANIZATION_MEMBER], first:100) { 
   nodes { owner {login} name }
   }
  }
}

And here’s the response:

{
  "data": {
    "viewer": {
      "repositories": {
        "nodes": [
          {
            "owner": {
              "login": "godot-italia"
            },
            "name": "Lyskar"
          },
          {
            "owner": {
              "login": "godot-italia"
            },
            "name": "Lyskar-Prototype"
          },
          {
            "owner": {
              "login": "godot-italia"
            },
            "name": "Game-of-Darios-life"
          },
          {
            "owner": {
              "login": "godot-italia"
            },
            "name": "asset-game-jam"
          },
          {
            "owner": {
              "login": "godot-italia"
            },
            "name": "2D-InverseKinematic"
          },
          {
            "owner": {
              "login": "godot-italia"
            },
            "name": "linee-guida-traduzione-italiana-godot"
          }
        ]
      }
    }
  }
}

Here’s my organizations.

The second one (fenixhub-org) only contains a private repository. That’s exactly the one not being listed.

Should I open an issue about this?