2

I have a GraphQL query to get GitHub pull requests. I need to filter pull requests by updated time. How can I do this?

1 Answer 1

4

Search can be used to filter pull requests in a range.

Here's an example

{
  search(first: 100, query: "repo:firstcontributions/first-contributions is:pr is:open updated:2020-01-01..2020-07-31", type: ISSUE) {
    nodes {
      ... on PullRequest {
        title
        url
      }
    }
  }
}

This fetches open pull requests between 1st January 2020 and 31st July 2020.

You can see that the search query uses the same syntax. So, basically you can try this by GitHub search too

https://github.com/search?q=repo%3Afirstcontributions%2Ffirst-contributions+is%3Apr+updated%3A2020-01-01..2020-07-31

Documentation about search can be found in GitHub search docs

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.