Last active
October 14, 2021 07:21
-
-
Save thewoolleyman/2294542455a8e673e0a844362e0b8bac to your computer and use it in GitHub Desktop.
github-graphql-commits-by-ref
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query { | |
repository(owner: "pivotaltracker", name: "tracker") { | |
refs(refPrefix: "refs/heads/", first: 100) { | |
totalCount | |
pageInfo { | |
hasNextPage | |
} | |
edges { | |
node { | |
name | |
target { | |
... on Commit { | |
history(first: 5) { | |
edges { | |
node { | |
oid | |
messageHeadline | |
committedDate | |
# message | |
# author { | |
# name | |
# date | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query { | |
repository(owner: "pivotaltracker", name: "tracker") { | |
refs(refPrefix: "refs/heads/", first: 100) { | |
totalCount | |
pageInfo { | |
hasNextPage | |
endCursor | |
} | |
edges { | |
... refEdgeFrag | |
} | |
} | |
} | |
} | |
fragment refEdgeFrag on RefEdge { | |
node { | |
name | |
target { | |
... on Commit { | |
history(first: 1) { | |
edges { | |
node { | |
oid | |
messageHeadline | |
committedDate | |
url | |
author { | |
name | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query { | |
repository(owner: "pivotaltracker", name: "tracker") { | |
r1: ref(qualifiedName: "master") { | |
name | |
}, | |
r2: ref(qualifiedName: "94195378-super-admin-import") { | |
name | |
} | |
} | |
} |
This was 4 years ago, I don't remember much about it :)
I would suggest looking at the current github graphql API docs and playing around in the graphql explorer.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
have you found a way to reference a commit by sha?