使用 graphql 从 github 提交统计信息

Commits stats from github using graphql

有人可以告诉我 - 哪里可以使用 graphql api 获取特定存储库的所有提交和统计信息? 现在我以这样的查询结束:

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
                }
              }
            }
          }
        }
      }
    }
  }
}
  }

但它只显示来自 'master' 的提交并且根本不显示统计信息,我想看到类似于 github rest api:

的内容
stats: {
total: 27
additions: 27
deletions: 0}

从支持人员那里得到答案

https://platform.github.community/t/commit-stats-for-commits-in-repository/2193/4

对于最新的架构更改,您可以这样做:

query{
  repository(owner:"education",name:"classroom"){
    defaultBranchRef{
      target{
        ... on Commit{
          changedFiles
          additions
          deletions
        }
      }
    }
}