I’am able to get filename, file content and commit date from github using graphql by three queries.
following are the querys :
# for getting filenames
query = """
{
repository(owner: \""""+ownerVal+"""\", name: \""""+repoVal+"""\") {
object(expression: \""""+branchVal+":"+folderVal+"""\") {
... on Tree{
entries{
name
}
}
}
}
}
"""
# for getting file content
query = """
{
repository(owner: \""""+ownerVal+"""\", name: \""""+repoVal+"""\") {
object(expression: \""""+branchVal+":"+folderVal+"/"+data['name']+"""\") {
... on Blob {
text
}
}
}
}
"""
# for getting commit date
query = """
{
repository(owner: \""""+ownerVal+"""\", name: \""""+repoVal+"""\") {
object(expression: \""""+branchVal+"""\") {
... on Commit {
blame(path: \""""+folderVal+"/"+data['name']+"""\") {
ranges {
commit {
committedDate
}
}
}
}
}
}
}
"""
How to get these three details by running one query?
ie, for each file in github i need to get filename, file content and commit date of the file.