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

Is there way to specify period in GitHub API v4?

How to write to get a list of issues created between 2017-01-01 and 2017-12-31 in GitHub API v4 ...?

What statement should I add to this query...? 

query{
            repository(owner: "kubernetes", name: "kubernetes"){
                getTime: issues(first: 100, orderBy:{direction:ASC, field: CREATED_AT}){
                    edges{
                        node{
                            title
                            createdAt
                            closedAt
                        }
                    }
                }
            }
        }
1 Reply
Community Manager
Message 2 of 2

Re: Is there way to specify period in GitHub API v4?

You have to use the Search API to perform that kind of query:

 

{
  search(first: 100, query: "repo:kubernetes/kubernetes is:issue created:2017-01-01..2017-12-31", type: ISSUE) {
    nodes {
      ... on Issue {
        title
        createdAt
        closedAt
      }
    }
  }
}

You can't sort the results, but you can paginate through all the results.

 

I hope that helps!