MCPcopy Index your code
hub / github.com/cli/cli / mapReplyFromNode

Function mapReplyFromNode

pkg/cmd/discussion/client/client.go:465–482  ·  view source on GitHub ↗

mapReplyFromNode converts a discussionReplyNode into the domain DiscussionComment type.

(n discussionReplyNode)

Source from the content-addressed store, hash-verified

463
464// mapReplyFromNode converts a discussionReplyNode into the domain DiscussionComment type.
465func 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.

Callers 2

mapCommentFromNodeFunction · 0.85
GetCommentRepliesMethod · 0.85

Calls 1

mapActorFromListNodeFunction · 0.85

Tested by

no test coverage detected