DeleteComment deletes a discussion comment or reply.
(repo ghrepo.Interface, commentID string)
| 1209 | |
| 1210 | // DeleteComment deletes a discussion comment or reply. |
| 1211 | func (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. |
| 1230 | func (c *discussionClient) GetComment(host string, commentID string) (*DiscussionComment, error) { |