Skip to content

Instantly share code, notes, and snippets.

@jonathansick
Last active January 20, 2024 07:58
Show Gist options
  • Star 34 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jonathansick/8bbe88a85addaeeea4e7fe9ef15b016b to your computer and use it in GitHub Desktop.
Save jonathansick/8bbe88a85addaeeea4e7fe9ef15b016b to your computer and use it in GitHub Desktop.
GitHub GraphQL repo commit history query
{
repository(name: "sickvim", owner: "jonathansick") {
ref(qualifiedName: "master") {
target {
... on Commit {
id
history(first: 5) {
pageInfo {
hasNextPage
}
edges {
node {
messageHeadline
oid
message
author {
name
email
date
}
}
}
}
}
}
}
}
}
@alexander-schranz
Copy link

I let this here maybe it helps somebody else to get commits for defaultBranchRef:

  {
    repository(owner: "sulu", name: "sulu") {
      defaultBranchRef {
        name
        target {
          ... on Commit {
            history {
              totalCount
            }
          }
        }
      }
      stargazers {
        totalCount
      }
      releases {
        totalCount
      }
    }
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment