问题
Can someone tell me - is where are a way to get all commits of specific repository with stats using graphql api? For now i end with query like this:
query {
viewer {
repository(name: "CRM_system") {
ref(qualifiedName: "master") {
target {
... on Commit {
id
history(since: my_date_time) {
edges {
node {
messageHeadline
oid
message
author {
name
email
date
}
}
}
}
}
}
}
}
}
}
But it show commits only from 'master' and doesnt show stats at all, i want to see something similar to github rest api:
stats: {
total: 27
additions: 27
deletions: 0}
回答1:
Get answer from support
https://platform.github.community/t/commit-stats-for-commits-in-repository/2193/4
With latest schema change you can do it this way:
query{
repository(owner:"education",name:"classroom"){
defaultBranchRef{
target{
... on Commit{
changedFiles
additions
deletions
}
}
}
}
来源:https://stackoverflow.com/questions/44723678/commits-stats-from-github-using-graphql