66 "strings"
77
88 "github.com/cli/go-gh/v2/pkg/api"
9+ graphql "github.com/cli/shurcooL-graphql"
910)
1011
1112// PullRequest represents a GitHub pull request.
@@ -68,9 +69,9 @@ func (c *Client) FindPRForBranch(branch string) (*PullRequest, error) {
6869 }
6970
7071 variables := map [string ]interface {}{
71- "owner" : c .owner ,
72- "name" : c .repo ,
73- "head" : branch ,
72+ "owner" : graphql . String ( c .owner ) ,
73+ "name" : graphql . String ( c .repo ) ,
74+ "head" : graphql . String ( branch ) ,
7475 }
7576
7677 if err := c .gql .Query ("FindPRForBranch" , & query , variables ); err != nil {
@@ -113,9 +114,9 @@ func (c *Client) GetPR(number int) (*PullRequest, error) {
113114 }
114115
115116 variables := map [string ]interface {}{
116- "owner" : c .owner ,
117- "name" : c .repo ,
118- "number" : number ,
117+ "owner" : graphql . String ( c .owner ) ,
118+ "name" : graphql . String ( c .repo ) ,
119+ "number" : graphql . Int ( number ) ,
119120 }
120121
121122 if err := c .gql .Query ("GetPR" , & query , variables ); err != nil {
@@ -314,7 +315,7 @@ func (c *Client) FindStackPRs(startPR *PullRequest) ([]*PullRequest, string, err
314315
315316func (c * Client ) fetchOpenPRs () ([]* PullRequest , error ) {
316317 var prs []* PullRequest
317- var cursor * string
318+ var cursor * graphql. String
318319
319320 for {
320321 var query struct {
@@ -339,8 +340,8 @@ func (c *Client) fetchOpenPRs() ([]*PullRequest, error) {
339340 }
340341
341342 variables := map [string ]interface {}{
342- "owner" : c .owner ,
343- "name" : c .repo ,
343+ "owner" : graphql . String ( c .owner ) ,
344+ "name" : graphql . String ( c .repo ) ,
344345 "cursor" : cursor ,
345346 }
346347
@@ -364,7 +365,7 @@ func (c *Client) fetchOpenPRs() ([]*PullRequest, error) {
364365 if ! query .Repository .PullRequests .PageInfo .HasNextPage {
365366 break
366367 }
367- endCursor := query .Repository .PullRequests .PageInfo .EndCursor
368+ endCursor := graphql . String ( query .Repository .PullRequests .PageInfo .EndCursor )
368369 cursor = & endCursor
369370 }
370371
@@ -392,8 +393,8 @@ func (c *Client) repositoryID() (string, error) {
392393 }
393394
394395 variables := map [string ]interface {}{
395- "owner" : c .owner ,
396- "name" : c .repo ,
396+ "owner" : graphql . String ( c .owner ) ,
397+ "name" : graphql . String ( c .repo ) ,
397398 }
398399
399400 if err := c .gql .Query ("RepositoryID" , & query , variables ); err != nil {
0 commit comments