(client *Client, repoHost string, params CommentCreateInput)
| 54 | } |
| 55 | |
| 56 | func CommentCreate(client *Client, repoHost string, params CommentCreateInput) (string, error) { |
| 57 | var mutation struct { |
| 58 | AddComment struct { |
| 59 | CommentEdge struct { |
| 60 | Node struct { |
| 61 | URL string |
| 62 | } |
| 63 | } |
| 64 | } `graphql:"addComment(input: $input)"` |
| 65 | } |
| 66 | |
| 67 | variables := map[string]interface{}{ |
| 68 | "input": githubv4.AddCommentInput{ |
| 69 | Body: githubv4.String(params.Body), |
| 70 | SubjectID: githubv4.ID(params.SubjectId), |
| 71 | }, |
| 72 | } |
| 73 | |
| 74 | err := client.Mutate(repoHost, "CommentCreate", &mutation, variables) |
| 75 | if err != nil { |
| 76 | return "", err |
| 77 | } |
| 78 | |
| 79 | return mutation.AddComment.CommentEdge.Node.URL, nil |
| 80 | } |
| 81 | |
| 82 | func CommentUpdate(client *Client, repoHost string, params CommentUpdateInput) (string, error) { |
| 83 | var mutation struct { |
no test coverage detected