github - GitHub API v4 (GraphQL) 中的突变很少?

标签 github graphql github-api

使用 GitHub GraphQL API (v4),是否可以执行这些任务?

  • 创建/编辑/删除存储库
  • 创建/编辑/删除版本
  • 创建/更新/合并拉取请求
  • 创建标签
  • 创建文件/blob

  • 我们正在讨论从 REST 迁移到 GraphQL,但没有这个功能似乎还为时过早。作为 GraphQL 的新手,我想确保我不会在某个地方错过这个功能。

    更新:

    来自 GitHub 员工(2018 年 4 月 21 日):

    Unfortunately, mutation coverage isn’t the best in our GraphQL API right now. The good news is that we have a focused team working on building out parity between REST and GraphQL. It’s hard to give ETAs on these mutations for you, but they’re on the list of things to do!

    最佳答案

    createRepository26 June 2019 上将突变添加到 GitHub 的 GraphQL API v4 .

    例如,以下突变创建一个新的公共(public)存储库“foo”:

    mutation { 
      createRepository(input:{name:"foo", visibility:PUBLIC}) { 
        clientMutationId,
        repository {
          id,
          nameWithOwner
        }
      }
    }
    

    updateRepository突变已添加到 17 July 2019 .

    ( create | merge | close )PullRequest 突变被添加到 24 October 2018 .

    创建标签( createRef ,严格来说)是在 28 June 2019 上添加的

    因此,截至 2019 年 7 月 29 日,我相信只有 blob、release 和 deleteRepository 的突变在您的列表中仍然未完成。

    关于github - GitHub API v4 (GraphQL) 中的突变很少?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49944137/

    相关文章:

    reactjs - GraphQL - Gatsby.js- React 组件。 - 如何查询变量/参数?

    javascript - 在 Gatsby.js 中使用 GraphQL 从 WP 获取 ACF Flexible 内容

    javascript - 获取每年 GitHub 用户贡献的数量

    javascript - 用于用户事件的 Node + Github webhook

    git - 如何上传.dll文件到github?

    git - 重置 git 模板路径

    php - 如何让 Composer 从 GitHub 下载 master 分支中的最新提交以获取包?

    graphql - GraphQL DataLoader 应该将请求包装到数据库还是将请求包装到服务方法?

    github - 如何删除 GitHub 状态检查?

    java - pom.xml 中的 Maven 部署参数