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
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
Documentation about search can be found in GitHub search docs