Skip to content

Instantly share code, notes, and snippets.

@Hollywood
Last active October 24, 2022 12:31
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hollywood/75a0569285e673280422e552631e29fd to your computer and use it in GitHub Desktop.
Save Hollywood/75a0569285e673280422e552631e29fd to your computer and use it in GitHub Desktop.
GraphQL Branch and Commit Queries by Repository
query getCommitsByBranchByRepo($org:String!,$repo:String!) {
organization(login:$org) {
name
repository(name:$repo) {
name
refs(refPrefix: "refs/heads/", first: 10) {
nodes {
id
name
target {
... on Commit {
history(first: 100) {
nodes {
messageHeadline
committedDate
author {
name
email
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment