Retrieving pull requests (and issues and comments) by given dates



Currently, there’s no way to retrieve pull requests, issues, or comments based on their created/closed/merged (etc.) dates. GraphQL’s strength is pulling back only exactly what the developer needs - it’d be great to be able to pull comments only from this week, for instance, instead of all comments and filtering (in my code) by a given date.

Here’s how I think this could possibly look for pull requests:

query {
  repository(owner: "octocat", name: "Hello-World") {
    pullRequests(first: 100, states: MERGED, createdAfter: "2018-08-11T13:45:00") {
      edges {
        node {

Just as you can query for certain states (MERGED, OPEN, CLOSED) you could query things like createdBefore , createdAfter , mergedBefore , mergedAfter , etc. for ISO-format datetime strings. This could be applied appropriately to pull requests, issues, and comments.

This feature would be incredible for the use case that made me want this feature (generating “What’s New” documentation automatically from PR templates) and I’m sure others would love this too!


:wave: @pbaity ,

Thank you for the schema request. I’ve added this information to a similar Schema Request we are tracking internally, we’ll update this thread when we have some more information.