5
votes

Using GitHub GraphQL API (v4), is it possible to do any of these tasks?

  • Create/edit/delete repositories
  • Create/edit/delete releases
  • Create/update/merge pull requests
  • Create tags
  • Create files/blobs

We were discussing migrating to GraphQL from REST but without this functionality it seems premature. Being new to GraphQL, I want to make sure I'm not missing this functionality somewhere.

UPDATE:

From GitHub Staff (April 21, 2018):

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!

1

1 Answers

4
votes

The createRepository mutation was added to GitHub's GraphQL API v4 on 26 June 2019.

For example, the following mutation creates a new, public repository "foo":

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

The updateRepository mutation was added on 17 July 2019.

The (create|merge|close)PullRequest mutations were added on 24 October 2018.

Creating tags (createRef, strictly speaking) was added on 28 June 2019

So, as of 29 July 2019, I believe there are just the mutations for blobs, releases, and deleteRepository that are still outstanding from your list.