Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 2

GraphQL API v4 PullRequestFilters Input Object

Solved! Go to Solution.

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?

 

1 Reply
Solution
Community Manager
Message 2 of 2

Re: GraphQL API v4 PullRequestFilters Input Object

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/


Best,
AndreaG

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!