Schema request to add states argument for the milestones connection

schema-request

#1

Hi,

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 {
        title
      }
    }
  }
}

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
#2

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.


#3

: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 {
            dueOn
          }
        }
      }
    }
  }
}

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


#4

Awesome @bswinnerton, thanks :raised_hands: