【问题标题】:Commits stats from github using graphql使用 graphql 从 github 提交统计信息
【发布时间】:2017-11-27 03:59:26
【问题描述】:

有人可以告诉我 - 使用 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}

【问题讨论】:

标签: github-api graphql


【解决方案1】:

从支持人员那里获得答案

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

【讨论】:

    猜你喜欢
    • 2019-12-06
    • 2023-03-25
    • 2019-03-25
    • 2021-05-28
    • 2020-01-07
    • 1970-01-01
    • 1970-01-01
    • 2019-10-22
    • 2022-10-14
    相关资源
    最近更新 更多