Schema request to add states argument for the milestones connection




It would be useful to be able to pass the states argument to the milestones connection in repository, so we can fetch closed and open milestones separately, similar to the issues connection:

  repository(owner:"facebook", name:"react") {
    milestones(first:10, states:[OPEN]) {
      nodes {

This is the corresponding REST API endpoint documentation. The REST endpoint also allows to sort the milestones by due_on and completeness.

Having this endpoint available would be great to calculate stats for teams using milestones as sprints (how many issues were closed on each sprint and the like). Is it possible to include this in the roadmap for GraphQL? Cheers!

Repository Filtered Milestone Request
Repository Filtered Milestone Request

Hi @pnavarrc!

Thank you for the schema request. This should be relatively straightforward for us to add. I’ve added it to our internal tracker. We’ll update you here when it’s added to the schema.


:wave: @pnavarrc,

We’ve just shipped a mechanism to sort milestones by their states, as well as a few new ways to order the results. They should be visible in the changelog sometime tomorrow. It looks something like this:

query($url:URI!) {
  resource(url:$url) {
    ... on Repository {
      milestones(first:20, states:[OPEN], orderBy:{field:DUE_DATE,direction:DESC}) {
        edges {
          node {

If there’s anything else you’d need regarding filtering or ordering milestones, feel free to let us know here.


Awesome @bswinnerton, thanks :raised_hands: