Inconsistency of empty state filter between Repository.issues and Repository.pullRequests fields

I’ve run into this minor inconsistency in the GitHub GraphQL API v4. Consider the following query:

query {
  repository(owner:"octocat", name:"Hello-World") {
    allIssues: issues {
      totalCount
    }
    allPRs: pullRequests {
      totalCount
    }
    issues (states:[]) {
      totalCount
    }
    pullRequests (states:[]) {
      totalCount
    }
  }
}

{
  "data": {
    "repository": {
      "allIssues": {
        "totalCount": 250
      },
      "allPRs": {
        "totalCount": 249
      },
      "issues": {
        "totalCount": 0
      },
      "pullRequests": {
        "totalCount": 249
      }
    }
  }
}

Notice that states:[] filters out all issues, but includes all PRs.

This is a minor inconsistency. It’d be better if providing states:[] had the same effect on issues and PRs.

Hi @dmitshur,

Thanks for this feedback! We’re always working to improve GitHub and the GitHub Community Forum, and we consider every suggestion we receive. I’ve logged your feature request in our internal feature request list. Though I can’t guarantee anything or share a timeline for this, I can tell you that it’s been shared with the appropriate teams for consideration.

Please let me know if you have any other questions.

Cheers!

1 Like