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