While composing a GraphQL to list repositories in an Organisation, what should I pass as QueryString? #39403
-
Select Topic AreaQuestion BodyI am composing a GraphQL query that will list the names of all repositories in a GitHub Organisation. The query is: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
searchquery ($queryString: String!) {
search(query: $queryString, type: REPOSITORY, first: 100) {
repositoryCount
edges {
node {
... on Repository {
name
}
}
}
}
} variable{ "queryString": "is:public archived:false org:cli" } You are limited to the following qualifiers: Searching for repositories
result{
"data": {
"search": {
"repositoryCount": 7,
"edges": [
{
"node": {
"name": "cli"
}
},
{
"node": {
"name": "oauth"
}
},
{
"node": {
"name": "go-gh"
}
},
{
"node": {
"name": "safeexec"
}
},
{
"node": {
"name": "gh-extension-precompile"
}
},
{
"node": {
"name": "scoop-gh"
}
},
{
"node": {
"name": "gh-webhook"
}
}
]
}
}
} organizationThis could be an alternative, since you already know the name of the organization and can filter out the repositories. {
organization(login: "cli") {
repositories(first: 100, isLocked: false, isFork: false, privacy: PUBLIC orderBy:{direction:DESC field:STARGAZERS}) {
totalCount
nodes {
name
}
}
}
} {
"data": {
"organization": {
"repositories": {
"totalCount": 7,
"nodes": [
{
"name": "cli"
},
{
"name": "oauth"
},
{
"name": "go-gh"
},
{
"name": "safeexec"
},
{
"name": "gh-extension-precompile"
},
{
"name": "scoop-gh"
},
{
"name": "gh-webhook"
}
]
}
}
}
} |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
search
variable
You are limited to the following qualifiers: Searching for repositories
owner
qualifier is not supportedorg
result