Get Issues and PullRequests by given user after given date


#1

I am looking to get the issues and pullRequests created by a given user after a given date.

I understand I can get the issues and pull requests created by a given user like this:

user(login: user){
    pullRequests(last:n){
        ...
    }
    issues(last:n){
        ...
    }
}

But this doesn’t seem to allow querying the items after a given date. I tried using the “search” functionality without success because “search” doesn’t exist on type “User”:

user(login: $login) {
	search(last: 100, type:ISSUE, query:"created:>2018-06-01"){
		nodes{
			... on Issue {
                ...
      		}
		}
	}
}

So far, the only solution I have is to filter the query response by date, which is not ideal since I request more data than I actually need.

Does anyone know of any other way to do this?


#2

:wave: @alexcourouble ,

I think using author in search instead might work for you, i.e

  search(last: 100, type:ISSUE, query:"author:alexcourouble created:>2018-06-01"){

Would this work for you?


#3

Thank you @SirCN!!