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

Method ValidLabels

api/graphql/resolvers/repo.go:166–191  ·  view source on GitHub ↗
(_ context.Context, obj *models.Repository, after *string, before *string, first *int, last *int)

Source from the content-addressed store, hash-verified

164}
165
166func (repoResolver) ValidLabels(_ context.Context, obj *models.Repository, after *string, before *string, first *int, last *int) (*models.LabelConnection, error) {
167 input := models.ConnectionInput{
168 Before: before,
169 After: after,
170 First: first,
171 Last: last,
172 }
173
174 edger := func(label common.Label, offset int) connections.Edge {
175 return models.LabelEdge{
176 Node: label,
177 Cursor: connections.OffsetToCursor(offset),
178 }
179 }
180
181 conMaker := func(edges []*models.LabelEdge, nodes []common.Label, info *models.PageInfo, totalCount int) (*models.LabelConnection, error) {
182 return &models.LabelConnection{
183 Edges: edges,
184 Nodes: nodes,
185 PageInfo: info,
186 TotalCount: totalCount,
187 }, nil
188 }
189
190 return connections.Connection(obj.Repo.Bugs().ValidLabels(), edger, conMaker, input)
191}

Callers

nothing calls this directly

Calls 4

OffsetToCursorFunction · 0.92
ConnectionFunction · 0.92
BugsMethod · 0.80
ValidLabelsMethod · 0.65

Tested by

no test coverage detected