Search code examples
graphqlgithub-apigithub-graphql

How to create issues and labels with the Github GraphQL Api?


V3 of the Api provides a REST interface for this:

POST /repos/:owner/:repo/issues

{
  "title": "Found a bug",
  "body": "I'm having a problem with this.",
  "assignees": [
    "octocat"
  ],
  "milestone": 1,
  "labels": [
    "bug"
  ]
} 

https://developer.github.com/v3/issues/

You can even add an emoji reaction with the GraphQL Api:

https://developer.github.com/v4/mutation/addreaction/

Or a comment:

https://developer.github.com/v4/mutation/addcomment/

I have looked at the mutations available and I can only conclude that you cannot make an issue with the new Api.

https://developer.github.com/v4/mutation/


Solution

  • Unfortunately a mutation to create issues (or labels) does not exist yet. You can submit a schema request at https://platform.github.community/c/graphql-api and GitHub will prioritize the creation of that mutation.