In GitHub API v3 with repo and user authorization scopes, I can get my organizations with GET /user/orgs
(https://developer.github.com/v3/orgs/#list-organizations-for-the-authenticated-user, with Octokit REST JS, octokit.orgs.listForAuthenticatedUser()
) and for each organization, to get the repositories which I have access, GET /orgs/:org/repos
(https://developer.github.com/v3/repos/#list-organization-repositories, with Octokit, octokit.repos.listForOrg({ org: orgs.data[i].login })
).
However, with the same authentication scope (user and repos), running this Graphql query
query getOrgsRepos {
viewer {
organizations(first: 10) {
nodes {
repositories(first: 10) {
nodes {
name
}
}
}
}
}
}
Returns
{
"data": {
"viewer": {
"organizations": {
"nodes": []
}
}
}
}
Graphql Explorer result (https://developer.github.com/v4/explorer/), but running on my JS authed (user and repo scopes) app returns the same empty result
How to have the same behaviour with API v4, without having to give further permissions?