MCPcopy Create free account
hub / github.com/git-bug/git-bug / Comments

Method Comments

api/graphql/resolvers/bug.go:21–55  ·  view source on GitHub ↗
(_ context.Context, obj models.BugWrapper, after *string, before *string, first *int, last *int)

Source from the content-addressed store, hash-verified

19}
20
21func (bugResolver) Comments(_ context.Context, obj models.BugWrapper, after *string, before *string, first *int, last *int) (*models.BugCommentConnection, error) {
22 input := models.ConnectionInput{
23 Before: before,
24 After: after,
25 First: first,
26 Last: last,
27 }
28
29 edger := func(comment bug.Comment, offset int) connections.Edge {
30 return models.BugCommentEdge{
31 Node: &comment,
32 Cursor: connections.OffsetToCursor(offset),
33 }
34 }
35
36 conMaker := func(edges []*models.BugCommentEdge, nodes []bug.Comment, info *models.PageInfo, totalCount int) (*models.BugCommentConnection, error) {
37 var commentNodes []*bug.Comment
38 for _, c := range nodes {
39 commentNodes = append(commentNodes, &c)
40 }
41 return &models.BugCommentConnection{
42 Edges: edges,
43 Nodes: commentNodes,
44 PageInfo: info,
45 TotalCount: totalCount,
46 }, nil
47 }
48
49 comments, err := obj.Comments()
50 if err != nil {
51 return nil, err
52 }
53
54 return connections.Connection(comments, edger, conMaker, input)
55}
56
57func (bugResolver) Operations(_ context.Context, obj models.BugWrapper, after *string, before *string, first *int, last *int) (*models.OperationConnection, error) {
58 input := models.ConnectionInput{

Callers

nothing calls this directly

Calls 3

OffsetToCursorFunction · 0.92
ConnectionFunction · 0.92
CommentsMethod · 0.65

Tested by

no test coverage detected