Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save navkast/4affda14676a5ecc7807440e1d814afe to your computer and use it in GitHub Desktop.
Save navkast/4affda14676a5ecc7807440e1d814afe to your computer and use it in GitHub Desktop.
Github GraphQL: Latest commits on a particular revision (branch or commit)
{
repository(owner: "microsoft", name: "vscode") {
object(expression: "720b72ea268ed1a0001b4be2cac35dbbfd74e079") {
... on Commit {
id
history(first: 5) {
nodes {
hash: oid
message
author {
name
date
user {
name
}
}
}
}
}
}
}
}
@navkast
Copy link
Author

navkast commented Apr 26, 2020

Also works with a branch name:

{
  repository(owner: "microsoft", name: "vscode") {
    object(expression: "master") { 
      ... on Commit {
        id
        history(first: 5) {
          nodes {
            hash: oid
            message
            author {
              name
              date
              user {
                name
              }
            }
          }
        }
      }
    }
  }
}

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