Skip to content

Instantly share code, notes, and snippets.

@smorcuend
Created October 8, 2019 09:48
Show Gist options
  • Save smorcuend/31975e48a9dbd68dedf3510608a87130 to your computer and use it in GitHub Desktop.
Save smorcuend/31975e48a9dbd68dedf3510608a87130 to your computer and use it in GitHub Desktop.
Github_APIv4: These queries will fetch the organization repository information that is sorted by the last push/commit made using the orderBy field
query($cursor: String, $org: String = "") {
organization(login: $org) {
repositories(
first: 50
after: $cursor
orderBy: { field: PUSHED_AT, direction: DESC }
) {
totalCount
pageInfo {
endCursor
__typename
}
edges {
cursor
node {
name
descriptionHTML
license
stargazers(first: 50) {
totalCount
}
repositoryTopics(first: 20) {
edges {
node {
topic {
name
}
}
}
}
forkCount
isFork
createdAt
updatedAt
pushedAt
homepageUrl
url
primaryLanguage {
name
color
}
collaborators(first: 50, affiliation: DIRECT) {
edges {
node {
name
login
avatarUrl
}
}
}
}
}
}
}
}
query($org: String = "") {
organization(login: $org) {
repositories(first: 50, orderBy: { field: PUSHED_AT, direction: DESC }) {
totalCount
pageInfo {
endCursor
__typename
}
edges {
node {
name
descriptionHTML
license
stargazers(first: 50) {
totalCount
}
repositoryTopics(first: 20) {
edges {
node {
topic {
name
}
}
}
}
forkCount
isFork
createdAt
updatedAt
pushedAt
homepageUrl
url
primaryLanguage {
name
color
}
collaborators(first: 50, affiliation: DIRECT) {
edges {
node {
name
login
avatarUrl
}
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment