Issue Filtering for updatedAt

schema-request

#1

I don’t believe it’s possible currently but I would like to be able to filter issues on updatedAt. The use case being I want to check if any new issues have either been created or closed. Right now I’d have to use states to either look at closed or open issues, and filter through those for newly closed/opened ones myself.

In tandem, being able to pull out specific issues would be helpful too. Can currently get a single issue off repository/issue but sometimes want more and they’re not obtained from before, after or `labels.

If this is currently possible somehow please let me know!


#2

Hi @mikhailbot!

I don’t believe it’s possible currently but I would like to be able to filter issues on updatedAt. The use case being I want to check if any new issues have either been created or closed. Right now I’d have to use states to either look at closed or open issues, and filter through those for newly closed/opened ones myself.

I think you could use our Search API to do that, specifically our endpoint for searching issues. For example, here’s how you could fetch the first 10 issues in your mikhailbot/meetsilver-web repository that were last updated on April 30th, 2017 @ 12:00AM:

query {
  search(query:"repo:mikhailbot/meetsilver-web updated:>2017-04-30T00:00:00Z", first:10, type:ISSUE) {
    edges {
      node {
        ... on Issue {
          number
          state
          updatedAt
        }
      }
    }
  }
}

For reference, here’s the analogous request using our REST API:

https://api.github.com/search/issues?q=repo:mikhailbot/meetsilver-web+updated:>2017-04-30T00:00:00Z

You also mentioned this:

In tandem, being able to pull out specific issues would be helpful too. Can currently get a single issue off repository/issue but sometimes want more and they’re not obtained from before, after or `labels.

I’m not sure what you mean here. Could you please help me understand what you mean by this by providing an example? Some more context would be great, thanks!


#3

Hmm OK, that makes sense. I hadn’t looked into the Search endpoint a bunch yet but yes that will probably solve what I’m trying to do.

Regarding the second, I cannot for the life of me remember what I was trying to do there…

The end goal is to monitor when new issues are closed on certain repo’s since the last time we checked. I’ve got it working with the REST API but will play more with GraphQL to see about moving over to get more specific data back (the REST API really spews all the fields on things).


#4

@mikhailbot - Thanks for writing back to clarify! When you do remember, feel free to reach out again and I’ll do my best to help. :slight_smile:


#5

hi,I use search like this:

query {
  search(query:"repo:numpy/numpy created:>2017-09-28T00:00:00Z",first:14, type:ISSUE) {
    issueCount
    edges {
      node {
        ... on Issue {
          number
          state
          updatedAt
          title
        }
      }
    }
  }
}

and I get result like this:

{
  "data": {
    "search": {
      "issueCount": 14,
      "edges": [
        {
          "node": {}
        },
        {
          "node": {
            "number": 9793,
            "state": "OPEN",
            "updatedAt": "2017-09-29T15:48:47Z",
            "title": "How to plot the numpy arrays?"
          }
        },
        {
          "node": {}
        },
        ...

It include some node is null, Why has this happened? How to filter that?


#6

The null node is pull request, In github pull request and issue the same set of signs。


#7

The problem with the search approach is that the rate limit is much lower, no?