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

Function mapReplyFromNode

pkg/cmd/discussion/client/client.go:462–479  ·  view source on GitHub ↗

mapReplyFromNode converts a discussionReplyNode into the domain DiscussionComment type.

(n discussionReplyNode)

Source from the content-addressed store, hash-verified

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

Callers 2

mapCommentFromNodeFunction · 0.85
GetCommentRepliesMethod · 0.85

Calls 1

mapActorFromListNodeFunction · 0.85

Tested by

no test coverage detected