mapReplyFromNode converts a discussionReplyNode into the domain DiscussionComment type.
(n discussionReplyNode)
| 463 | |
| 464 | // mapReplyFromNode converts a discussionReplyNode into the domain DiscussionComment type. |
| 465 | func mapReplyFromNode(n discussionReplyNode) DiscussionComment { |
| 466 | rc := DiscussionComment{ |
| 467 | ID: n.ID, |
| 468 | URL: n.URL, |
| 469 | Author: mapActorFromListNode(n.Author), |
| 470 | Body: n.Body, |
| 471 | CreatedAt: n.CreatedAt, |
| 472 | IsAnswer: n.IsAnswer, |
| 473 | UpvoteCount: n.UpvoteCount, |
| 474 | } |
| 475 | for _, rg := range n.ReactionGroups { |
| 476 | rc.ReactionGroups = append(rc.ReactionGroups, ReactionGroup{ |
| 477 | Content: rg.Content, |
| 478 | TotalCount: rg.Users.TotalCount, |
| 479 | }) |
| 480 | } |
| 481 | return rc |
| 482 | } |
| 483 | |
| 484 | // discussionCommentNode is the GraphQL response shape for a discussion comment |
| 485 | // including nested replies. |
no test coverage detected