0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

how to get github discussions categoryId

Last updated at Posted at 2022-03-05

gh api graphql -f query='
{
  # https://github.com/github/docs

  repository(owner: "github", name: "docs") {
    id # RepositoryID
    name
    discussionCategories(first: 10) {
      nodes {
        id # CategoryID
        name
      }
    }
  }
}'

Result:

{
  "data": {
    "repository": {
      "id": "MDEwOlJlcG9zaXRvcnkxODk2MjE2MDc=",
      "name": "docs",
      "discussionCategories": {
        "nodes": [{
            "id": "MDE4OkRpc2N1c3Npb25DYXRlZ29yeTI1MDUzMjQ3",
            "name": "General"
          },
          {
            "id": "MDE4OkRpc2N1c3Npb25DYXRlZ29yeTI1MDUzMjUw",
            "name": "Ideas"
          },
          {
            "id": "MDE4OkRpc2N1c3Npb25DYXRlZ29yeTI1MDUzMjQ5",
            "name": "Q&A"
          },
          {
            "id": "MDE4OkRpc2N1c3Npb25DYXRlZ29yeTI1MDUzMjUx",
            "name": "Show and tell"
          }
        ]
      }
    }
  }
}

Ref:

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?