kowainik / github-graphql

🕸️ GraphQL bindings to GitHub API
https://kowainik.github.io/projects/github-graphql
Mozilla Public License 2.0
7 stars 0 forks source link

Support querying Milestone by number and add helper query to get milestone by number #35

Closed chshersh closed 3 years ago

chshersh commented 3 years ago

Currently we don't have a way to query Milestone by number:

query { 
  repository(owner: "kowainik", name: "hit-on") {
    milestone(number: 1) {
      id
    }
  }
}

With the response:

{
  "data": {
    "repository": {
      "milestone": {
        "id": "MDk6TWlsZXN0b25lNDQ4MDI1Mg=="
      }
    }
  }
}

For this, we need to add a milestone connection to Repository. Similar to Issue/Issues we need to have Milestone/Milestones:

Additionally, it would be nice to have a helper function to query MilestoneId similar to querying RepositoryId:

And add tests for this function (e.g. using the example in this issue).