How to query OPEN Pull Requests


#1

I am attempting to fetch OPEN Pull Requests from a given repository and I seem to be running into a snag and I’m unsure if my query is malformed. I’m hopeful that someone may have a tip or different approach. Here’s my query:

query {
  repositoryOwner(login:"moderntribe") {
    repository(name:"the-events-calendar") {
      pullRequests(first:10, states:[OPEN]) {
        edges {
          node {
            title
            state
          }
        }
      }
    }
  }
}

Here’s the response:

{
  "data": null,
  "errors": [
    {
      "message": "We couldn't execute your query at this time."
    }
  ]
}

Any thoughts would be greatly appreciated!


#2

It appears that if I do a similar query against issues, my results are as expected:

query {
  repositoryOwner(login:"moderntribe") {
    repository(name:"the-events-calendar") {
      issues(states:[OPEN], first:10) {
        edges {
          node {
            title
            state
          }
        }
      }
    }
  }
}

I’m just curious about the difference between issues and pullRequests.


#3

Whoops, look like we’ve got a server-side bug. That query should work just as well as it does for issues, so we’ll be taking a look at this very soon. Thanks for reporting it!


#4

@davidcelis is there a place where we can report bugs/issues like this one? I’ve run into a couple of these with a very similar response from the server.


#5

@helfer This forum is the best place to report bugs or issues with the GraphQL API :thumbsup:


#6

Hey @borkweb! This is definitely a bug on our side. I pushed out a fix just now so the query you posted should now work just fine :smile:


#7

That’s great news! Thank you!