GraphQL API v4 PullRequestFilters Input Object

I’m trying to get all issues and pull request since date. For issues it is easy:

query {
  viewer {
    name
    repository(name: "test") {
      issues(first:10, filterBy: { since: "2018-11-06T10:43:22Z" }) {
        edges {
          node {
            title
            updatedAt
          }
        }
      }
    }
  }
}

Unfortunately same thing can’t be done for PullRequest. It is a bit strange beacuse PullRequest is an Issue anyway. Is there any chance for PullRequestFilters? Or search query is the only way to get it?

Hi @kongo555,

Thank you for being here! Here is a query that would help:

{
  search(query: "repo:atom/atom is:pr is:open created:>2019-04-01", type: ISSUE, last: 100) {
    edges {
      node {
        ... on PullRequest {
          url
          title
          createdAt
        }
      }
    }
  }
}

You’ll need to use pagination to fetch further results, and I’d recommend taking a read through the official documentation for using cursors and pages here: https://graphql.org/learn/pagination/

1 Like