I wanna query all repositories in my organization on github private, i try to use
query {
organization(login:"my-org-name") {
id
name
url
repositories(first:100) {
nodes {
id
name
}
}
}
}
However it returns
{
"data": {
"organization": {
"id": "MDEyOk*********************U4ODUw",
"name": "my-org-name",
"url": "https://github.com/my-org-name",
"repositories": {
"nodes": []
}
}
}
}
can't find any repositories. I test it on Github Developer, https://developer.github.com/v4/explorer/
you can achieve using search
end point (you need to be authenticated)
query myOrgRepos($queryString: String!) {
search(query: $queryString, type: REPOSITORY, first: 10) {
repositoryCount
edges {
node {
... on Repository {
name
}
}
}
}
}
with query variables
{
"queryString": "org:my_org"
}
Note that as expected you do not get the list repositories of your organization, you get the list of your organization list that you have access
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With