【问题标题】:How to filter github pull request by updated date using graphql?如何使用graphql按更新日期过滤github拉取请求?
【发布时间】:2020-08-12 02:16:47
【问题描述】:

我有一个 GraphQL 查询来获取 GitHub 拉取请求。我需要按更新时间过滤拉取请求。我该怎么做?

【问题讨论】:

    标签: github graphql


    【解决方案1】:

    搜索可用于过滤范围内的拉取请求。

    这是一个例子

    {
      search(first: 100, query: "repo:firstcontributions/first-contributions is:pr is:open updated:2020-01-01..2020-07-31", type: ISSUE) {
        nodes {
          ... on PullRequest {
            title
            url
          }
        }
      }
    }
    

    这会获取 2020 年 1 月 1 日至 2020 年 7 月 31 日之间的开放拉取请求。

    您可以看到搜索查询使用相同的语法。所以,基本上你也可以通过 GitHub 搜索试试这个

    https://github.com/search?q=repo%3Afirstcontributions%2Ffirst-contributions+is%3Apr+updated%3A2020-01-01..2020-07-31

    关于搜索的文档可以在GitHub search docs找到

    【讨论】:

      猜你喜欢
      • 2017-08-22
      • 2015-02-16
      • 2018-06-17
      • 2018-10-15
      • 1970-01-01
      • 2017-12-29
      • 2013-06-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多