MCPcopy Create free account
hub / github.com/cli/cli / DeleteComment

Method DeleteComment

pkg/cmd/discussion/client/client.go:1211–1227  ·  view source on GitHub ↗

DeleteComment deletes a discussion comment or reply.

(repo ghrepo.Interface, commentID string)

Source from the content-addressed store, hash-verified

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