Multiple commit attributes [using "aliases"]
https://github.com/orgs/community/discussions/24419
File names
query = """
{
repository(owner: \""""+ownerVal+"""\", name: \""""+repoVal+"""\") {
object(expression: \""""+branchVal+":"+folderVal+"""\") {
... on Tree{
entries{
name
}
}
}
}
}
"""
File contents
query = """
{
repository(owner: """"+ownerVal+"""", name: """"+repoVal+"""") {
object(expression: """"+branchVal+":"+folderVal+"/"+data['name']+"""") {
... on Blob {
text
}
}
}
}
"""
Commit date
query = """
{
repository(owner: """"+ownerVal+"""", name: """"+repoVal+"""") {
object(expression: """"+branchVal+"""") {
... on Commit {
blame(path: """"+folderVal+"/"+data['name']+"""") {
ranges {
commit {
committedDate
}
}
}
}
}
}
}
"""
Getting commits from default branch (ref)
https://stackoverflow.com/questions/48285888/github-graphql-getting-a-repositorys-list-of-commits
... on Repository{
defaultBranchRef{
target{
... on Commit{
history(first:10){
edges{
node{
... on Commit{
committedDate
}
}
}
}
}
}
}
}
Resource limitations [official docs]
https://docs.github.com/en/graphql/overview/resource-limitations
Official GraphQL API explorer playground