actionSince parameter on bill times out APIv2


#1

Hey folks, I wasn’t sure if this was more appropriate as a GitHub issue or a discussion here. The GitHub specified that the issue tracker was for state-specific API issues, and this seems to affect the entire API v2, just on the bill node.

If I run something like:

{
  bills(actionSince: "2019-01-01", first: 3) {
    edges {
      node {
        id
      }
    }
  }
}

The response at https://openstates.org/graphql is:

"<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>502 Bad Gateway</h1></center>\r\n<hr><center>nginx/1.14.0 (Ubuntu)</center>\r\n</body>\r\n</html>\r\n"

I’m getting similar responses in my own scripts. Looks like I should be able to query with this param, according to https://docs.openstates.org/en/latest/api/v2/root-nodes.html#bills

Am I missing something/bad formatting? Or is something broken here?


#2

I’ve seen this symptom on some kinds of queries before, usually ones that I’d never do in production but am trying out just to kick the tires. In particular, I’ve seen it on queries that don’t narrow down to a state. My last encounter was several months ago; sorry I can’t be more precise.

The query works if you include a jurisdiction in the query e.g.:

{
  bills(jurisdiction: "ocd-jurisdiction/country:us/state:ne/government", 
        actionSince: "2019-01-01", 
        first: 3) {
    edges {
      node {
        id
      }
    }
  }
}

#3

Thanks, Ed! That is actually somewhat helpful. I was trying to start with some more general queries, and I think this still may be a bug, but makes sense that getting more specific returns better data. I’ll try out some more specific tries, and hopefully someone out there is looking into the issue with the general ones.

FWIW, searching by updatedSince seems to work just fine for larger data sets (and is what I’ve settled on doing, for the most part).


#4

if you can open an issue for this that’d be great, it does look like we can tune that better


#5

@ogdenstudios opened https://github.com/openstates/openstates/issues/2809