From cf822e4d9ceb565b767feb8c572295051cf40f39 Mon Sep 17 00:00:00 2001 From: chemotaxis Date: Tue, 23 Aug 2022 01:35:19 -0400 Subject: [PATCH] Remove direct calls to graphql library Similar to commit 45f1a71c8bae265ecd9985812e32a6f9d34027c5 --- pkg/cmd/issue/lock/lock.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/pkg/cmd/issue/lock/lock.go b/pkg/cmd/issue/lock/lock.go index 9f4b6c045..6edace756 100644 --- a/pkg/cmd/issue/lock/lock.go +++ b/pkg/cmd/issue/lock/lock.go @@ -11,7 +11,6 @@ package lock import ( - "context" "fmt" "net/http" "strings" @@ -19,12 +18,10 @@ import ( "github.com/AlecAivazis/survey/v2" "github.com/cli/cli/v2/api" "github.com/cli/cli/v2/internal/config" - "github.com/cli/cli/v2/internal/ghinstance" "github.com/cli/cli/v2/internal/ghrepo" issueShared "github.com/cli/cli/v2/pkg/cmd/issue/shared" "github.com/cli/cli/v2/pkg/cmdutil" "github.com/cli/cli/v2/pkg/iostreams" - graphql "github.com/cli/shurcooL-graphql" "github.com/shurcooL/githubv4" "github.com/spf13/cobra" ) @@ -254,9 +251,8 @@ func lockLockable(httpClient *http.Client, repo ghrepo.Interface, lockable *api. }, } - gql := graphql.NewClient(ghinstance.GraphQLEndpoint(repo.RepoHost()), httpClient) - - return gql.MutateNamed(context.Background(), "LockLockable", &mutation, variables) + gql := api.NewClientFromHTTP(httpClient) + return gql.Mutate(repo.RepoHost(), "LockLockable", &mutation, variables) } // unlockLockable will lock an issue or pull request @@ -276,9 +272,8 @@ func unlockLockable(httpClient *http.Client, repo ghrepo.Interface, lockable *ap }, } - gql := graphql.NewClient(ghinstance.GraphQLEndpoint(repo.RepoHost()), httpClient) - - return gql.MutateNamed(context.Background(), "UnlockLockable", &mutation, variables) + gql := api.NewClientFromHTTP(httpClient) + return gql.Mutate(repo.RepoHost(), "UnlockLockable", &mutation, variables) } // relockLockable will unlock then lock an issue or pull request. A common use