【问题标题】:How to use Github GraphQL search for my own commits?如何使用 Github GraphQL 搜索我自己的提交?
【发布时间】:2018-10-24 12:27:31
【问题描述】:

我正在尝试使用 Github GraphQL 来获取我的组织在本月和上个月之间的提交列表。我可以指定前 100 个提交并向后分页,

repository(owner: "myOrg", name: "myRepo") {
    ref(qualifiedName: "master") {
        target {
        ... on Commit {
            history(first: 100) {

但似乎应该将 API 设置为允许更具体的搜索,因此它不必做太多工作。我知道您可以使用search query 查询Repositories, Issues, and Users,但这似乎与仅询问我需要的特定结果不同。

在不发出大量不必要请求的情况下,使用 GraphQL 过滤特定提交或任何信息的最佳方法是什么?

谢谢!

【问题讨论】:

    标签: github graphql github-api


    【解决方案1】:

    你试过sinceuntil吗?

    像这样:

    repository(owner: "myOrg", name: "myRepo") {
        ref(qualifiedName: "master") {
            target {
            ... on Commit {
                history(since: "2018-04-01T22:29:24+00:00", until: "2018-05-14T22:29:24+00:00") {
    

    【讨论】:

      猜你喜欢
      • 2019-03-25
      • 2016-08-28
      • 2021-12-30
      • 2022-10-14
      • 2013-08-09
      • 1970-01-01
      • 2023-03-27
      • 2018-08-27
      • 2017-11-27
      相关资源
      最近更新 更多