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

Filter pull requests by author

Solved! Go to Solution.

I'd like to get details of pull requests from a repository by a given author / user.  I'd like to use an argument for author in the query shown below.  Do I need to use a search filter?  I'm using the Explorer and I don't see which arguments can be used for particular fields or the syntax and arguments for the search field.

query ($number_of_pull_requests: Int!) {
  repository(owner: "myorganization", name: "reponame") {
    pullRequests(first: $number_of_pull_requests, orderBy: {field: CREATED_AT, direction: DESC}) {
      edges {
        cursor
        node {
          id
          closedAt
          number
          author {
            login
          }
        }
      }
    }
  }
}
1 Reply
Solution
Pilot Lvl 1
Message 2 of 2

Re: Filter pull requests by author

@Simon-at-Timeshift 

 

Yes you can try it via a search query

 

query searchRepos($qstr: String!, $first: Int!) {
  search(query: $qstr, type: ISSUE, first: $first) {
    nodes {
      __typename
      ... on PullRequest {
        url
        number
        author {
          login
        }
      }
    }
  }
}

 

{
    "qstr": "repo:parithiban/git-slack-bot type:pr is:open author:parithiban",
    "first": 5    
}

 

Screen Shot 2019-11-30 at 7.12.29 PM.png