Is there any way to fetch districts by House/Senate chamber id


#1

This post was flagged by the community and is temporarily hidden.


#2

You’re not alone; 5 days ago I filed https://github.com/openstates/new-openstates.org/issues/126 .

The best you can do now is to get most of them by fetching all the legislators, posts and divisions, and filter out non-unique ones by division id. Note that post.maxMemberships tells the number of seats. This will not get any districts where all the seats are vacant. Here’s my query, fwiw:

{
  jurisdiction(name: "Colorado") {
    organizations(classification: ["lower", "upper", "legislature"], first: 3) {
      edges {
        node {
          classification
          currentMemberships {
            post {
              maximumMemberships
              division {
                id
                name
              }
            }
          }
        }
      }
    }
  }
}

BTW, I’ve started an Exploring Open States blog with you in mind as audience. But it looks like you’re getting up to speed pretty fast without it!