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

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.