首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >针对给定作者的PR上的所有评论的图QL查询

针对给定作者的PR上的所有评论的图QL查询
EN

Stack Overflow用户
提问于 2017-07-12 08:19:56
回答 1查看 168关注 0票数 1

我想出了这个:

代码语言:javascript
复制
{
  repository(owner: "hawkular", name: "hawkular.github.io") {
    pullRequest(number: 237) {
      comments(first: 10) {
        nodes {
          body
          author {
            login
          }
        }
      }
    }
  }
}

它返回给定PR上的所有注释:

代码语言:javascript
复制
{
  "data": {
    "repository": {
      "pullRequest": {
        "comments": {
          "nodes": [
            {
              "body": "PR was auto-deployed here: http://209.132.178.114:10237 and it will be available for 4 days.\n",
              "author": {
                "login": "hawkular-website-bot"
              }
            },
            {
              "body": "Any ETA for this blog post to be finished/published ?",
              "author": {
                "login": "theute"
              }
            },
            {
              "body": "After PR696 in hawkular-metrics I will continue.. helps me to create something repetable",
              "author": {
                "login": "burmanm"
              }
            },
            {
              "body": "PR was auto-deployed here: http://209.132.178.114:10237 and it will be available for 4 days.",
              "author": {
                "login": "hawkular-website-bot"
              }
            },
            {
              "body": "The article cites `CompressionData` job, but it should be `CompressData`.",
              "author": {
                "login": "jsanda"
              }
            },
            {
              "body": "Is this PR active ? Severla months without activity.",
              "author": {
                "login": "lucasponce"
              }
            }
          ]
        }
      }
    }
  }

然而,我只对那些由hawkular-website-bot编写的代码感兴趣。有没有办法在Git Hub Graph QL api中指定作者?

EN

回答 1

Stack Overflow用户

发布于 2020-08-08 03:01:25

对于类型PullRequestConnection中的作者,没有筛选条件。因此您不能根据作者来过滤拉取请求。但是你可以使用像这样的搜索查询功能

代码语言:javascript
复制
{
  search(query: "repo: hawkular/hawkular.github.io is:pr is:open author:hawkular-website-bot", last:10, type:ISSUE){
    edges{
      node{
        ... on PullRequest{
          body
          title
        }
      }
    }
  }
}

有关详细信息,请参阅this

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45046384

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档