1// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
2
3package graph
4
5import (
6 "context"
7 "errors"
8 "fmt"
9 "strconv"
10 "sync"
11 "sync/atomic"
12
13 "github.com/99designs/gqlgen/graphql"
14 "github.com/git-bug/git-bug/api/graphql/models"
15 "github.com/git-bug/git-bug/entities/bug"
16 "github.com/git-bug/git-bug/entity"
17 "github.com/git-bug/git-bug/repository"
18 "github.com/vektah/gqlparser/v2/ast"
19)
20
21// region ************************** generated!.gotpl **************************
22
23type BugCommentResolver interface {
24 Author(ctx context.Context, obj *bug.Comment) (models.IdentityWrapper, error)
25}
26
27// endregion ************************** generated!.gotpl **************************
28
29// region ***************************** args.gotpl *****************************
30
31// endregion ***************************** args.gotpl *****************************
32
33// region ************************** directives.gotpl **************************
34
35// endregion ************************** directives.gotpl **************************
36
37// region **************************** field.gotpl *****************************
38
39func (ec *executionContext) _BugComment_id(ctx context.Context, field graphql.CollectedField, obj *bug.Comment) (ret graphql.Marshaler) {
40 fc, err := ec.fieldContext_BugComment_id(ctx, field)
41 if err != nil {
42 return graphql.Null
43 }
44 ctx = graphql.WithFieldContext(ctx, fc)
45 defer func() {
46 if r := recover(); r != nil {
47 ec.Error(ctx, ec.Recover(ctx, r))
48 ret = graphql.Null
49 }
50 }()
51 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
52 ctx = rctx // use context from middleware stack in children
53 return obj.CombinedId(), nil
54 })
55 if err != nil {
56 ec.Error(ctx, err)
57 return graphql.Null
58 }
59 if resTmp == nil {
60 if !graphql.HasFieldError(ctx, fc) {
61 ec.Errorf(ctx, "must not be null")
62 }
63 return graphql.Null
64 }
65 res := resTmp.(entity.CombinedId)
66 fc.Result = res
67 return ec.marshalNCombinedId2githubᚗcomᚋgitᚑbugᚋgitᚑbugᚋentityᚐCombinedId(ctx, field.Selections, res)
68}
69
70func (ec *executionContext) fieldContext_BugComment_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
71 fc = &graphql.FieldContext{
72 Object: "BugComment",
73 Field: field,
74 IsMethod: true,
75 IsResolver: false,
76 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
77 return nil, errors.New("field of type CombinedId does not have child fields")
78 },
79 }
80 return fc, nil
81}
82
83func (ec *executionContext) _BugComment_author(ctx context.Context, field graphql.CollectedField, obj *bug.Comment) (ret graphql.Marshaler) {
84 fc, err := ec.fieldContext_BugComment_author(ctx, field)
85 if err != nil {
86 return graphql.Null
87 }
88 ctx = graphql.WithFieldContext(ctx, fc)
89 defer func() {
90 if r := recover(); r != nil {
91 ec.Error(ctx, ec.Recover(ctx, r))
92 ret = graphql.Null
93 }
94 }()
95 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
96 ctx = rctx // use context from middleware stack in children
97 return ec.resolvers.BugComment().Author(rctx, obj)
98 })
99 if err != nil {
100 ec.Error(ctx, err)
101 return graphql.Null
102 }
103 if resTmp == nil {
104 if !graphql.HasFieldError(ctx, fc) {
105 ec.Errorf(ctx, "must not be null")
106 }
107 return graphql.Null
108 }
109 res := resTmp.(models.IdentityWrapper)
110 fc.Result = res
111 return ec.marshalNIdentity2githubᚗcomᚋgitᚑbugᚋgitᚑbugᚋapiᚋgraphqlᚋmodelsᚐIdentityWrapper(ctx, field.Selections, res)
112}
113
114func (ec *executionContext) fieldContext_BugComment_author(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
115 fc = &graphql.FieldContext{
116 Object: "BugComment",
117 Field: field,
118 IsMethod: true,
119 IsResolver: true,
120 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
121 switch field.Name {
122 case "id":
123 return ec.fieldContext_Identity_id(ctx, field)
124 case "humanId":
125 return ec.fieldContext_Identity_humanId(ctx, field)
126 case "name":
127 return ec.fieldContext_Identity_name(ctx, field)
128 case "email":
129 return ec.fieldContext_Identity_email(ctx, field)
130 case "login":
131 return ec.fieldContext_Identity_login(ctx, field)
132 case "displayName":
133 return ec.fieldContext_Identity_displayName(ctx, field)
134 case "avatarUrl":
135 return ec.fieldContext_Identity_avatarUrl(ctx, field)
136 case "isProtected":
137 return ec.fieldContext_Identity_isProtected(ctx, field)
138 }
139 return nil, fmt.Errorf("no field named %q was found under type Identity", field.Name)
140 },
141 }
142 return fc, nil
143}
144
145func (ec *executionContext) _BugComment_message(ctx context.Context, field graphql.CollectedField, obj *bug.Comment) (ret graphql.Marshaler) {
146 fc, err := ec.fieldContext_BugComment_message(ctx, field)
147 if err != nil {
148 return graphql.Null
149 }
150 ctx = graphql.WithFieldContext(ctx, fc)
151 defer func() {
152 if r := recover(); r != nil {
153 ec.Error(ctx, ec.Recover(ctx, r))
154 ret = graphql.Null
155 }
156 }()
157 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
158 ctx = rctx // use context from middleware stack in children
159 return obj.Message, nil
160 })
161 if err != nil {
162 ec.Error(ctx, err)
163 return graphql.Null
164 }
165 if resTmp == nil {
166 if !graphql.HasFieldError(ctx, fc) {
167 ec.Errorf(ctx, "must not be null")
168 }
169 return graphql.Null
170 }
171 res := resTmp.(string)
172 fc.Result = res
173 return ec.marshalNString2string(ctx, field.Selections, res)
174}
175
176func (ec *executionContext) fieldContext_BugComment_message(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
177 fc = &graphql.FieldContext{
178 Object: "BugComment",
179 Field: field,
180 IsMethod: false,
181 IsResolver: false,
182 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
183 return nil, errors.New("field of type String does not have child fields")
184 },
185 }
186 return fc, nil
187}
188
189func (ec *executionContext) _BugComment_files(ctx context.Context, field graphql.CollectedField, obj *bug.Comment) (ret graphql.Marshaler) {
190 fc, err := ec.fieldContext_BugComment_files(ctx, field)
191 if err != nil {
192 return graphql.Null
193 }
194 ctx = graphql.WithFieldContext(ctx, fc)
195 defer func() {
196 if r := recover(); r != nil {
197 ec.Error(ctx, ec.Recover(ctx, r))
198 ret = graphql.Null
199 }
200 }()
201 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
202 ctx = rctx // use context from middleware stack in children
203 return obj.Files, nil
204 })
205 if err != nil {
206 ec.Error(ctx, err)
207 return graphql.Null
208 }
209 if resTmp == nil {
210 if !graphql.HasFieldError(ctx, fc) {
211 ec.Errorf(ctx, "must not be null")
212 }
213 return graphql.Null
214 }
215 res := resTmp.([]repository.Hash)
216 fc.Result = res
217 return ec.marshalNHash2ᚕgithubᚗcomᚋgitᚑbugᚋgitᚑbugᚋrepositoryᚐHashᚄ(ctx, field.Selections, res)
218}
219
220func (ec *executionContext) fieldContext_BugComment_files(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
221 fc = &graphql.FieldContext{
222 Object: "BugComment",
223 Field: field,
224 IsMethod: false,
225 IsResolver: false,
226 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
227 return nil, errors.New("field of type Hash does not have child fields")
228 },
229 }
230 return fc, nil
231}
232
233func (ec *executionContext) _BugCommentConnection_edges(ctx context.Context, field graphql.CollectedField, obj *models.BugCommentConnection) (ret graphql.Marshaler) {
234 fc, err := ec.fieldContext_BugCommentConnection_edges(ctx, field)
235 if err != nil {
236 return graphql.Null
237 }
238 ctx = graphql.WithFieldContext(ctx, fc)
239 defer func() {
240 if r := recover(); r != nil {
241 ec.Error(ctx, ec.Recover(ctx, r))
242 ret = graphql.Null
243 }
244 }()
245 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
246 ctx = rctx // use context from middleware stack in children
247 return obj.Edges, nil
248 })
249 if err != nil {
250 ec.Error(ctx, err)
251 return graphql.Null
252 }
253 if resTmp == nil {
254 if !graphql.HasFieldError(ctx, fc) {
255 ec.Errorf(ctx, "must not be null")
256 }
257 return graphql.Null
258 }
259 res := resTmp.([]*models.BugCommentEdge)
260 fc.Result = res
261 return ec.marshalNBugCommentEdge2ᚕᚖgithubᚗcomᚋgitᚑbugᚋgitᚑbugᚋapiᚋgraphqlᚋmodelsᚐBugCommentEdgeᚄ(ctx, field.Selections, res)
262}
263
264func (ec *executionContext) fieldContext_BugCommentConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
265 fc = &graphql.FieldContext{
266 Object: "BugCommentConnection",
267 Field: field,
268 IsMethod: false,
269 IsResolver: false,
270 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
271 switch field.Name {
272 case "cursor":
273 return ec.fieldContext_BugCommentEdge_cursor(ctx, field)
274 case "node":
275 return ec.fieldContext_BugCommentEdge_node(ctx, field)
276 }
277 return nil, fmt.Errorf("no field named %q was found under type BugCommentEdge", field.Name)
278 },
279 }
280 return fc, nil
281}
282
283func (ec *executionContext) _BugCommentConnection_nodes(ctx context.Context, field graphql.CollectedField, obj *models.BugCommentConnection) (ret graphql.Marshaler) {
284 fc, err := ec.fieldContext_BugCommentConnection_nodes(ctx, field)
285 if err != nil {
286 return graphql.Null
287 }
288 ctx = graphql.WithFieldContext(ctx, fc)
289 defer func() {
290 if r := recover(); r != nil {
291 ec.Error(ctx, ec.Recover(ctx, r))
292 ret = graphql.Null
293 }
294 }()
295 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
296 ctx = rctx // use context from middleware stack in children
297 return obj.Nodes, nil
298 })
299 if err != nil {
300 ec.Error(ctx, err)
301 return graphql.Null
302 }
303 if resTmp == nil {
304 if !graphql.HasFieldError(ctx, fc) {
305 ec.Errorf(ctx, "must not be null")
306 }
307 return graphql.Null
308 }
309 res := resTmp.([]*bug.Comment)
310 fc.Result = res
311 return ec.marshalNBugComment2ᚕᚖgithubᚗcomᚋgitᚑbugᚋgitᚑbugᚋentitiesᚋbugᚐCommentᚄ(ctx, field.Selections, res)
312}
313
314func (ec *executionContext) fieldContext_BugCommentConnection_nodes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
315 fc = &graphql.FieldContext{
316 Object: "BugCommentConnection",
317 Field: field,
318 IsMethod: false,
319 IsResolver: false,
320 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
321 switch field.Name {
322 case "id":
323 return ec.fieldContext_BugComment_id(ctx, field)
324 case "author":
325 return ec.fieldContext_BugComment_author(ctx, field)
326 case "message":
327 return ec.fieldContext_BugComment_message(ctx, field)
328 case "files":
329 return ec.fieldContext_BugComment_files(ctx, field)
330 }
331 return nil, fmt.Errorf("no field named %q was found under type BugComment", field.Name)
332 },
333 }
334 return fc, nil
335}
336
337func (ec *executionContext) _BugCommentConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *models.BugCommentConnection) (ret graphql.Marshaler) {
338 fc, err := ec.fieldContext_BugCommentConnection_pageInfo(ctx, field)
339 if err != nil {
340 return graphql.Null
341 }
342 ctx = graphql.WithFieldContext(ctx, fc)
343 defer func() {
344 if r := recover(); r != nil {
345 ec.Error(ctx, ec.Recover(ctx, r))
346 ret = graphql.Null
347 }
348 }()
349 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
350 ctx = rctx // use context from middleware stack in children
351 return obj.PageInfo, nil
352 })
353 if err != nil {
354 ec.Error(ctx, err)
355 return graphql.Null
356 }
357 if resTmp == nil {
358 if !graphql.HasFieldError(ctx, fc) {
359 ec.Errorf(ctx, "must not be null")
360 }
361 return graphql.Null
362 }
363 res := resTmp.(*models.PageInfo)
364 fc.Result = res
365 return ec.marshalNPageInfo2ᚖgithubᚗcomᚋgitᚑbugᚋgitᚑbugᚋapiᚋgraphqlᚋmodelsᚐPageInfo(ctx, field.Selections, res)
366}
367
368func (ec *executionContext) fieldContext_BugCommentConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
369 fc = &graphql.FieldContext{
370 Object: "BugCommentConnection",
371 Field: field,
372 IsMethod: false,
373 IsResolver: false,
374 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
375 switch field.Name {
376 case "hasNextPage":
377 return ec.fieldContext_PageInfo_hasNextPage(ctx, field)
378 case "hasPreviousPage":
379 return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field)
380 case "startCursor":
381 return ec.fieldContext_PageInfo_startCursor(ctx, field)
382 case "endCursor":
383 return ec.fieldContext_PageInfo_endCursor(ctx, field)
384 }
385 return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name)
386 },
387 }
388 return fc, nil
389}
390
391func (ec *executionContext) _BugCommentConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *models.BugCommentConnection) (ret graphql.Marshaler) {
392 fc, err := ec.fieldContext_BugCommentConnection_totalCount(ctx, field)
393 if err != nil {
394 return graphql.Null
395 }
396 ctx = graphql.WithFieldContext(ctx, fc)
397 defer func() {
398 if r := recover(); r != nil {
399 ec.Error(ctx, ec.Recover(ctx, r))
400 ret = graphql.Null
401 }
402 }()
403 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
404 ctx = rctx // use context from middleware stack in children
405 return obj.TotalCount, nil
406 })
407 if err != nil {
408 ec.Error(ctx, err)
409 return graphql.Null
410 }
411 if resTmp == nil {
412 if !graphql.HasFieldError(ctx, fc) {
413 ec.Errorf(ctx, "must not be null")
414 }
415 return graphql.Null
416 }
417 res := resTmp.(int)
418 fc.Result = res
419 return ec.marshalNInt2int(ctx, field.Selections, res)
420}
421
422func (ec *executionContext) fieldContext_BugCommentConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
423 fc = &graphql.FieldContext{
424 Object: "BugCommentConnection",
425 Field: field,
426 IsMethod: false,
427 IsResolver: false,
428 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
429 return nil, errors.New("field of type Int does not have child fields")
430 },
431 }
432 return fc, nil
433}
434
435func (ec *executionContext) _BugCommentEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *models.BugCommentEdge) (ret graphql.Marshaler) {
436 fc, err := ec.fieldContext_BugCommentEdge_cursor(ctx, field)
437 if err != nil {
438 return graphql.Null
439 }
440 ctx = graphql.WithFieldContext(ctx, fc)
441 defer func() {
442 if r := recover(); r != nil {
443 ec.Error(ctx, ec.Recover(ctx, r))
444 ret = graphql.Null
445 }
446 }()
447 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
448 ctx = rctx // use context from middleware stack in children
449 return obj.Cursor, nil
450 })
451 if err != nil {
452 ec.Error(ctx, err)
453 return graphql.Null
454 }
455 if resTmp == nil {
456 if !graphql.HasFieldError(ctx, fc) {
457 ec.Errorf(ctx, "must not be null")
458 }
459 return graphql.Null
460 }
461 res := resTmp.(string)
462 fc.Result = res
463 return ec.marshalNString2string(ctx, field.Selections, res)
464}
465
466func (ec *executionContext) fieldContext_BugCommentEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
467 fc = &graphql.FieldContext{
468 Object: "BugCommentEdge",
469 Field: field,
470 IsMethod: false,
471 IsResolver: false,
472 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
473 return nil, errors.New("field of type String does not have child fields")
474 },
475 }
476 return fc, nil
477}
478
479func (ec *executionContext) _BugCommentEdge_node(ctx context.Context, field graphql.CollectedField, obj *models.BugCommentEdge) (ret graphql.Marshaler) {
480 fc, err := ec.fieldContext_BugCommentEdge_node(ctx, field)
481 if err != nil {
482 return graphql.Null
483 }
484 ctx = graphql.WithFieldContext(ctx, fc)
485 defer func() {
486 if r := recover(); r != nil {
487 ec.Error(ctx, ec.Recover(ctx, r))
488 ret = graphql.Null
489 }
490 }()
491 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
492 ctx = rctx // use context from middleware stack in children
493 return obj.Node, nil
494 })
495 if err != nil {
496 ec.Error(ctx, err)
497 return graphql.Null
498 }
499 if resTmp == nil {
500 if !graphql.HasFieldError(ctx, fc) {
501 ec.Errorf(ctx, "must not be null")
502 }
503 return graphql.Null
504 }
505 res := resTmp.(*bug.Comment)
506 fc.Result = res
507 return ec.marshalNBugComment2ᚖgithubᚗcomᚋgitᚑbugᚋgitᚑbugᚋentitiesᚋbugᚐComment(ctx, field.Selections, res)
508}
509
510func (ec *executionContext) fieldContext_BugCommentEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
511 fc = &graphql.FieldContext{
512 Object: "BugCommentEdge",
513 Field: field,
514 IsMethod: false,
515 IsResolver: false,
516 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
517 switch field.Name {
518 case "id":
519 return ec.fieldContext_BugComment_id(ctx, field)
520 case "author":
521 return ec.fieldContext_BugComment_author(ctx, field)
522 case "message":
523 return ec.fieldContext_BugComment_message(ctx, field)
524 case "files":
525 return ec.fieldContext_BugComment_files(ctx, field)
526 }
527 return nil, fmt.Errorf("no field named %q was found under type BugComment", field.Name)
528 },
529 }
530 return fc, nil
531}
532
533// endregion **************************** field.gotpl *****************************
534
535// region **************************** input.gotpl *****************************
536
537// endregion **************************** input.gotpl *****************************
538
539// region ************************** interface.gotpl ***************************
540
541// endregion ************************** interface.gotpl ***************************
542
543// region **************************** object.gotpl ****************************
544
545var bugCommentImplementors = []string{"BugComment", "Authored"}
546
547func (ec *executionContext) _BugComment(ctx context.Context, sel ast.SelectionSet, obj *bug.Comment) graphql.Marshaler {
548 fields := graphql.CollectFields(ec.OperationContext, sel, bugCommentImplementors)
549
550 out := graphql.NewFieldSet(fields)
551 deferred := make(map[string]*graphql.FieldSet)
552 for i, field := range fields {
553 switch field.Name {
554 case "__typename":
555 out.Values[i] = graphql.MarshalString("BugComment")
556 case "id":
557 out.Values[i] = ec._BugComment_id(ctx, field, obj)
558 if out.Values[i] == graphql.Null {
559 atomic.AddUint32(&out.Invalids, 1)
560 }
561 case "author":
562 field := field
563
564 innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
565 defer func() {
566 if r := recover(); r != nil {
567 ec.Error(ctx, ec.Recover(ctx, r))
568 }
569 }()
570 res = ec._BugComment_author(ctx, field, obj)
571 if res == graphql.Null {
572 atomic.AddUint32(&fs.Invalids, 1)
573 }
574 return res
575 }
576
577 if field.Deferrable != nil {
578 dfs, ok := deferred[field.Deferrable.Label]
579 di := 0
580 if ok {
581 dfs.AddField(field)
582 di = len(dfs.Values) - 1
583 } else {
584 dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
585 deferred[field.Deferrable.Label] = dfs
586 }
587 dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
588 return innerFunc(ctx, dfs)
589 })
590
591 // don't run the out.Concurrently() call below
592 out.Values[i] = graphql.Null
593 continue
594 }
595
596 out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
597 case "message":
598 out.Values[i] = ec._BugComment_message(ctx, field, obj)
599 if out.Values[i] == graphql.Null {
600 atomic.AddUint32(&out.Invalids, 1)
601 }
602 case "files":
603 out.Values[i] = ec._BugComment_files(ctx, field, obj)
604 if out.Values[i] == graphql.Null {
605 atomic.AddUint32(&out.Invalids, 1)
606 }
607 default:
608 panic("unknown field " + strconv.Quote(field.Name))
609 }
610 }
611 out.Dispatch(ctx)
612 if out.Invalids > 0 {
613 return graphql.Null
614 }
615
616 atomic.AddInt32(&ec.deferred, int32(len(deferred)))
617
618 for label, dfs := range deferred {
619 ec.processDeferredGroup(graphql.DeferredGroup{
620 Label: label,
621 Path: graphql.GetPath(ctx),
622 FieldSet: dfs,
623 Context: ctx,
624 })
625 }
626
627 return out
628}
629
630var bugCommentConnectionImplementors = []string{"BugCommentConnection"}
631
632func (ec *executionContext) _BugCommentConnection(ctx context.Context, sel ast.SelectionSet, obj *models.BugCommentConnection) graphql.Marshaler {
633 fields := graphql.CollectFields(ec.OperationContext, sel, bugCommentConnectionImplementors)
634
635 out := graphql.NewFieldSet(fields)
636 deferred := make(map[string]*graphql.FieldSet)
637 for i, field := range fields {
638 switch field.Name {
639 case "__typename":
640 out.Values[i] = graphql.MarshalString("BugCommentConnection")
641 case "edges":
642 out.Values[i] = ec._BugCommentConnection_edges(ctx, field, obj)
643 if out.Values[i] == graphql.Null {
644 out.Invalids++
645 }
646 case "nodes":
647 out.Values[i] = ec._BugCommentConnection_nodes(ctx, field, obj)
648 if out.Values[i] == graphql.Null {
649 out.Invalids++
650 }
651 case "pageInfo":
652 out.Values[i] = ec._BugCommentConnection_pageInfo(ctx, field, obj)
653 if out.Values[i] == graphql.Null {
654 out.Invalids++
655 }
656 case "totalCount":
657 out.Values[i] = ec._BugCommentConnection_totalCount(ctx, field, obj)
658 if out.Values[i] == graphql.Null {
659 out.Invalids++
660 }
661 default:
662 panic("unknown field " + strconv.Quote(field.Name))
663 }
664 }
665 out.Dispatch(ctx)
666 if out.Invalids > 0 {
667 return graphql.Null
668 }
669
670 atomic.AddInt32(&ec.deferred, int32(len(deferred)))
671
672 for label, dfs := range deferred {
673 ec.processDeferredGroup(graphql.DeferredGroup{
674 Label: label,
675 Path: graphql.GetPath(ctx),
676 FieldSet: dfs,
677 Context: ctx,
678 })
679 }
680
681 return out
682}
683
684var bugCommentEdgeImplementors = []string{"BugCommentEdge"}
685
686func (ec *executionContext) _BugCommentEdge(ctx context.Context, sel ast.SelectionSet, obj *models.BugCommentEdge) graphql.Marshaler {
687 fields := graphql.CollectFields(ec.OperationContext, sel, bugCommentEdgeImplementors)
688
689 out := graphql.NewFieldSet(fields)
690 deferred := make(map[string]*graphql.FieldSet)
691 for i, field := range fields {
692 switch field.Name {
693 case "__typename":
694 out.Values[i] = graphql.MarshalString("BugCommentEdge")
695 case "cursor":
696 out.Values[i] = ec._BugCommentEdge_cursor(ctx, field, obj)
697 if out.Values[i] == graphql.Null {
698 out.Invalids++
699 }
700 case "node":
701 out.Values[i] = ec._BugCommentEdge_node(ctx, field, obj)
702 if out.Values[i] == graphql.Null {
703 out.Invalids++
704 }
705 default:
706 panic("unknown field " + strconv.Quote(field.Name))
707 }
708 }
709 out.Dispatch(ctx)
710 if out.Invalids > 0 {
711 return graphql.Null
712 }
713
714 atomic.AddInt32(&ec.deferred, int32(len(deferred)))
715
716 for label, dfs := range deferred {
717 ec.processDeferredGroup(graphql.DeferredGroup{
718 Label: label,
719 Path: graphql.GetPath(ctx),
720 FieldSet: dfs,
721 Context: ctx,
722 })
723 }
724
725 return out
726}
727
728// endregion **************************** object.gotpl ****************************
729
730// region ***************************** type.gotpl *****************************
731
732func (ec *executionContext) marshalNBugComment2ᚕᚖgithubᚗcomᚋgitᚑbugᚋgitᚑbugᚋentitiesᚋbugᚐCommentᚄ(ctx context.Context, sel ast.SelectionSet, v []*bug.Comment) graphql.Marshaler {
733 ret := make(graphql.Array, len(v))
734 var wg sync.WaitGroup
735 isLen1 := len(v) == 1
736 if !isLen1 {
737 wg.Add(len(v))
738 }
739 for i := range v {
740 i := i
741 fc := &graphql.FieldContext{
742 Index: &i,
743 Result: &v[i],
744 }
745 ctx := graphql.WithFieldContext(ctx, fc)
746 f := func(i int) {
747 defer func() {
748 if r := recover(); r != nil {
749 ec.Error(ctx, ec.Recover(ctx, r))
750 ret = nil
751 }
752 }()
753 if !isLen1 {
754 defer wg.Done()
755 }
756 ret[i] = ec.marshalNBugComment2ᚖgithubᚗcomᚋgitᚑbugᚋgitᚑbugᚋentitiesᚋbugᚐComment(ctx, sel, v[i])
757 }
758 if isLen1 {
759 f(i)
760 } else {
761 go f(i)
762 }
763
764 }
765 wg.Wait()
766
767 for _, e := range ret {
768 if e == graphql.Null {
769 return graphql.Null
770 }
771 }
772
773 return ret
774}
775
776func (ec *executionContext) marshalNBugComment2ᚖgithubᚗcomᚋgitᚑbugᚋgitᚑbugᚋentitiesᚋbugᚐComment(ctx context.Context, sel ast.SelectionSet, v *bug.Comment) graphql.Marshaler {
777 if v == nil {
778 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
779 ec.Errorf(ctx, "the requested element is null which the schema does not allow")
780 }
781 return graphql.Null
782 }
783 return ec._BugComment(ctx, sel, v)
784}
785
786func (ec *executionContext) marshalNBugCommentConnection2githubᚗcomᚋgitᚑbugᚋgitᚑbugᚋapiᚋgraphqlᚋmodelsᚐBugCommentConnection(ctx context.Context, sel ast.SelectionSet, v models.BugCommentConnection) graphql.Marshaler {
787 return ec._BugCommentConnection(ctx, sel, &v)
788}
789
790func (ec *executionContext) marshalNBugCommentConnection2ᚖgithubᚗcomᚋgitᚑbugᚋgitᚑbugᚋapiᚋgraphqlᚋmodelsᚐBugCommentConnection(ctx context.Context, sel ast.SelectionSet, v *models.BugCommentConnection) graphql.Marshaler {
791 if v == nil {
792 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
793 ec.Errorf(ctx, "the requested element is null which the schema does not allow")
794 }
795 return graphql.Null
796 }
797 return ec._BugCommentConnection(ctx, sel, v)
798}
799
800func (ec *executionContext) marshalNBugCommentEdge2ᚕᚖgithubᚗcomᚋgitᚑbugᚋgitᚑbugᚋapiᚋgraphqlᚋmodelsᚐBugCommentEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*models.BugCommentEdge) graphql.Marshaler {
801 ret := make(graphql.Array, len(v))
802 var wg sync.WaitGroup
803 isLen1 := len(v) == 1
804 if !isLen1 {
805 wg.Add(len(v))
806 }
807 for i := range v {
808 i := i
809 fc := &graphql.FieldContext{
810 Index: &i,
811 Result: &v[i],
812 }
813 ctx := graphql.WithFieldContext(ctx, fc)
814 f := func(i int) {
815 defer func() {
816 if r := recover(); r != nil {
817 ec.Error(ctx, ec.Recover(ctx, r))
818 ret = nil
819 }
820 }()
821 if !isLen1 {
822 defer wg.Done()
823 }
824 ret[i] = ec.marshalNBugCommentEdge2ᚖgithubᚗcomᚋgitᚑbugᚋgitᚑbugᚋapiᚋgraphqlᚋmodelsᚐBugCommentEdge(ctx, sel, v[i])
825 }
826 if isLen1 {
827 f(i)
828 } else {
829 go f(i)
830 }
831
832 }
833 wg.Wait()
834
835 for _, e := range ret {
836 if e == graphql.Null {
837 return graphql.Null
838 }
839 }
840
841 return ret
842}
843
844func (ec *executionContext) marshalNBugCommentEdge2ᚖgithubᚗcomᚋgitᚑbugᚋgitᚑbugᚋapiᚋgraphqlᚋmodelsᚐBugCommentEdge(ctx context.Context, sel ast.SelectionSet, v *models.BugCommentEdge) graphql.Marshaler {
845 if v == nil {
846 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
847 ec.Errorf(ctx, "the requested element is null which the schema does not allow")
848 }
849 return graphql.Null
850 }
851 return ec._BugCommentEdge(ctx, sel, v)
852}
853
854// endregion ***************************** type.gotpl *****************************