// ListPulls lists all open pulls requests for the current repository
ListPulls lists all open pulls requests for the current repository
// ListPulls lists all open pulls requests for the current repository
func ListPulls(client GithubQueryer) (pulls []GithubPullRequest, err error) {
	o, repository, err := repositoryDetails()
	if err != nil {
		return
	}
	variables := map[string]interface{}{
		"owner":       githubv4.String(o),
		"repository":  githubv4.String(repository),
		"pullsCursor": (*githubv4.String)(nil),
		"pageSize":    githubv4.Int(defaultPageSize),
	}
	var query pullRequestQuery
	for {
		err = client.Query(&query, variables)
		if err != nil {
			return
		}
		pulls = append(pulls, query.Repository.PullRequests.Nodes...)
		if !query.Repository.PullRequests.PageInfo.HasNextPage {
			break
		}
		variables["pullsCursor"] = githubv4.NewString(query.Repository.PullRequests.PageInfo.EndCursor)
	}
	return
}
func ListPulls ( client GithubQueryer ) ( pulls [ ] GithubPullRequest , err error ) { o , repository , err := repositoryDetails ( ) if err != nil { return } variables := map [ string ] interface { } { " " : githubv4 . String ( o ) , " " : githubv4 . String ( repository ) , " " : ( * githubv4 . String ) ( nil ) , " " : githubv4 . Int ( defaultPageSize ) , } var query pullRequestQuery for { err = client . Query ( & query , variables ) if err != nil { return } pulls = append ( pulls , query . Repository . PullRequests . Nodes ... ) if ! query . Repository . PullRequests . PageInfo . HasNextPage { break } variables [ " " ] = githubv4 . NewString ( query . Repository . PullRequests . PageInfo . EndCursor ) } return }
ListPulls lists all open pulls requests for the current repository
ListPulls lists all open pulls requests for the current repository