MCPcopy
hub / github.com/cli/cli / DeleteComment

Method DeleteComment

pkg/cmd/discussion/client/client.go:1214–1230  ·  view source on GitHub ↗

DeleteComment deletes a discussion comment or reply.

(repo ghrepo.Interface, commentID string)

Source from the content-addressed store, hash-verified

1212
1213// DeleteComment deletes a discussion comment or reply.
1214func (c *discussionClient) DeleteComment(repo ghrepo.Interface, commentID string) error {
1215 var mutation struct {
1216 DeleteDiscussionComment struct {
1217 Comment struct {
1218 ID string
1219 }
1220 } `graphql:"deleteDiscussionComment(input: $input)"`
1221 }
1222
1223 variables := map[string]interface{}{
1224 "input": githubv4.DeleteDiscussionCommentInput{
1225 ID: githubv4.ID(commentID),
1226 },
1227 }
1228
1229 return c.gql.Mutate(repo.RepoHost(), "DeleteDiscussionComment", &mutation, variables)
1230}
1231
1232// GetComment fetches a single discussion comment by node ID.
1233func (c *discussionClient) GetComment(host string, commentID string) (*DiscussionComment, error) {

Callers

nothing calls this directly

Calls 3

IDMethod · 0.65
MutateMethod · 0.65
RepoHostMethod · 0.65

Tested by

no test coverage detected