MCPcopy
hub / github.com/cli/cli / apiReopen

Function apiReopen

pkg/cmd/issue/reopen/reopen.go:118–139  ·  view source on GitHub ↗
(httpClient *http.Client, repo ghrepo.Interface, issue *api.Issue)

Source from the content-addressed store, hash-verified

116}
117
118func apiReopen(httpClient *http.Client, repo ghrepo.Interface, issue *api.Issue) error {
119 if issue.IsPullRequest() {
120 return api.PullRequestReopen(httpClient, repo, issue.ID)
121 }
122
123 var mutation struct {
124 ReopenIssue struct {
125 Issue struct {
126 ID githubv4.ID
127 }
128 } `graphql:"reopenIssue(input: $input)"`
129 }
130
131 variables := map[string]interface{}{
132 "input": githubv4.ReopenIssueInput{
133 IssueID: issue.ID,
134 },
135 }
136
137 gql := api.NewClientFromHTTP(httpClient)
138 return gql.Mutate(repo.RepoHost(), "IssueReopen", &mutation, variables)
139}

Callers 1

reopenRunFunction · 0.85

Calls 5

PullRequestReopenFunction · 0.92
NewClientFromHTTPFunction · 0.92
MutateMethod · 0.65
RepoHostMethod · 0.65
IsPullRequestMethod · 0.45

Tested by

no test coverage detected