Query issue totalCount at previous point in time


#1

I’m looking to make a query that returns the number of open issues on a particular date, but I can’t work out how to perform this filter operation in a query similar to that below

query { 
  repository(owner:"foo", name:"bar") { 
    issues {
      totalCount
    }
  }
}```

#2

Hi @nzjrs,

I’m not sure that you can do that with the Issues connection off the Repository object at the moment - currently you can’t filter issues by date there.

However, you could try using the search connection (https://developer.github.com/v4/query/#connections, under “search”) … here’s an example that I think would get at what you want:

{
  search(query: "repo: github/graphql-client created:<2018-01-01 closed:>2018-01-01", type: ISSUE, last: 10) {
    issueCount
  }
}

and the result

{
  "data": {
    "search": {
      "issueCount": 56
    }
  }
}

In this query, I’m searching for a count of the issues in the github/graphql-client repo that were created before January 1 and closed after January 1.

Hope that helps!