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/MichaelMure/git-bug/api/graphql/models"
15 "github.com/MichaelMure/git-bug/entity"
16 "github.com/vektah/gqlparser/v2/ast"
17)
18
19// region ************************** generated!.gotpl **************************
20
21type IdentityResolver interface {
22 HumanID(ctx context.Context, obj models.IdentityWrapper) (string, error)
23}
24
25// endregion ************************** generated!.gotpl **************************
26
27// region ***************************** args.gotpl *****************************
28
29// endregion ***************************** args.gotpl *****************************
30
31// region ************************** directives.gotpl **************************
32
33// endregion ************************** directives.gotpl **************************
34
35// region **************************** field.gotpl *****************************
36
37func (ec *executionContext) _Identity_id(ctx context.Context, field graphql.CollectedField, obj models.IdentityWrapper) (ret graphql.Marshaler) {
38 fc, err := ec.fieldContext_Identity_id(ctx, field)
39 if err != nil {
40 return graphql.Null
41 }
42 ctx = graphql.WithFieldContext(ctx, fc)
43 defer func() {
44 if r := recover(); r != nil {
45 ec.Error(ctx, ec.Recover(ctx, r))
46 ret = graphql.Null
47 }
48 }()
49 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
50 ctx = rctx // use context from middleware stack in children
51 return obj.Id(), nil
52 })
53 if err != nil {
54 ec.Error(ctx, err)
55 return graphql.Null
56 }
57 if resTmp == nil {
58 if !graphql.HasFieldError(ctx, fc) {
59 ec.Errorf(ctx, "must not be null")
60 }
61 return graphql.Null
62 }
63 res := resTmp.(entity.Id)
64 fc.Result = res
65 return ec.marshalNID2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentityᚐId(ctx, field.Selections, res)
66}
67
68func (ec *executionContext) fieldContext_Identity_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
69 fc = &graphql.FieldContext{
70 Object: "Identity",
71 Field: field,
72 IsMethod: true,
73 IsResolver: false,
74 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
75 return nil, errors.New("field of type ID does not have child fields")
76 },
77 }
78 return fc, nil
79}
80
81func (ec *executionContext) _Identity_humanId(ctx context.Context, field graphql.CollectedField, obj models.IdentityWrapper) (ret graphql.Marshaler) {
82 fc, err := ec.fieldContext_Identity_humanId(ctx, field)
83 if err != nil {
84 return graphql.Null
85 }
86 ctx = graphql.WithFieldContext(ctx, fc)
87 defer func() {
88 if r := recover(); r != nil {
89 ec.Error(ctx, ec.Recover(ctx, r))
90 ret = graphql.Null
91 }
92 }()
93 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
94 ctx = rctx // use context from middleware stack in children
95 return ec.resolvers.Identity().HumanID(rctx, obj)
96 })
97 if err != nil {
98 ec.Error(ctx, err)
99 return graphql.Null
100 }
101 if resTmp == nil {
102 if !graphql.HasFieldError(ctx, fc) {
103 ec.Errorf(ctx, "must not be null")
104 }
105 return graphql.Null
106 }
107 res := resTmp.(string)
108 fc.Result = res
109 return ec.marshalNString2string(ctx, field.Selections, res)
110}
111
112func (ec *executionContext) fieldContext_Identity_humanId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
113 fc = &graphql.FieldContext{
114 Object: "Identity",
115 Field: field,
116 IsMethod: true,
117 IsResolver: true,
118 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
119 return nil, errors.New("field of type String does not have child fields")
120 },
121 }
122 return fc, nil
123}
124
125func (ec *executionContext) _Identity_name(ctx context.Context, field graphql.CollectedField, obj models.IdentityWrapper) (ret graphql.Marshaler) {
126 fc, err := ec.fieldContext_Identity_name(ctx, field)
127 if err != nil {
128 return graphql.Null
129 }
130 ctx = graphql.WithFieldContext(ctx, fc)
131 defer func() {
132 if r := recover(); r != nil {
133 ec.Error(ctx, ec.Recover(ctx, r))
134 ret = graphql.Null
135 }
136 }()
137 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
138 ctx = rctx // use context from middleware stack in children
139 return obj.Name(), nil
140 })
141 if err != nil {
142 ec.Error(ctx, err)
143 return graphql.Null
144 }
145 if resTmp == nil {
146 return graphql.Null
147 }
148 res := resTmp.(string)
149 fc.Result = res
150 return ec.marshalOString2string(ctx, field.Selections, res)
151}
152
153func (ec *executionContext) fieldContext_Identity_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
154 fc = &graphql.FieldContext{
155 Object: "Identity",
156 Field: field,
157 IsMethod: true,
158 IsResolver: false,
159 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
160 return nil, errors.New("field of type String does not have child fields")
161 },
162 }
163 return fc, nil
164}
165
166func (ec *executionContext) _Identity_email(ctx context.Context, field graphql.CollectedField, obj models.IdentityWrapper) (ret graphql.Marshaler) {
167 fc, err := ec.fieldContext_Identity_email(ctx, field)
168 if err != nil {
169 return graphql.Null
170 }
171 ctx = graphql.WithFieldContext(ctx, fc)
172 defer func() {
173 if r := recover(); r != nil {
174 ec.Error(ctx, ec.Recover(ctx, r))
175 ret = graphql.Null
176 }
177 }()
178 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
179 ctx = rctx // use context from middleware stack in children
180 return obj.Email()
181 })
182 if err != nil {
183 ec.Error(ctx, err)
184 return graphql.Null
185 }
186 if resTmp == nil {
187 return graphql.Null
188 }
189 res := resTmp.(string)
190 fc.Result = res
191 return ec.marshalOString2string(ctx, field.Selections, res)
192}
193
194func (ec *executionContext) fieldContext_Identity_email(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
195 fc = &graphql.FieldContext{
196 Object: "Identity",
197 Field: field,
198 IsMethod: true,
199 IsResolver: false,
200 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
201 return nil, errors.New("field of type String does not have child fields")
202 },
203 }
204 return fc, nil
205}
206
207func (ec *executionContext) _Identity_login(ctx context.Context, field graphql.CollectedField, obj models.IdentityWrapper) (ret graphql.Marshaler) {
208 fc, err := ec.fieldContext_Identity_login(ctx, field)
209 if err != nil {
210 return graphql.Null
211 }
212 ctx = graphql.WithFieldContext(ctx, fc)
213 defer func() {
214 if r := recover(); r != nil {
215 ec.Error(ctx, ec.Recover(ctx, r))
216 ret = graphql.Null
217 }
218 }()
219 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
220 ctx = rctx // use context from middleware stack in children
221 return obj.Login()
222 })
223 if err != nil {
224 ec.Error(ctx, err)
225 return graphql.Null
226 }
227 if resTmp == nil {
228 return graphql.Null
229 }
230 res := resTmp.(string)
231 fc.Result = res
232 return ec.marshalOString2string(ctx, field.Selections, res)
233}
234
235func (ec *executionContext) fieldContext_Identity_login(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
236 fc = &graphql.FieldContext{
237 Object: "Identity",
238 Field: field,
239 IsMethod: true,
240 IsResolver: false,
241 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
242 return nil, errors.New("field of type String does not have child fields")
243 },
244 }
245 return fc, nil
246}
247
248func (ec *executionContext) _Identity_displayName(ctx context.Context, field graphql.CollectedField, obj models.IdentityWrapper) (ret graphql.Marshaler) {
249 fc, err := ec.fieldContext_Identity_displayName(ctx, field)
250 if err != nil {
251 return graphql.Null
252 }
253 ctx = graphql.WithFieldContext(ctx, fc)
254 defer func() {
255 if r := recover(); r != nil {
256 ec.Error(ctx, ec.Recover(ctx, r))
257 ret = graphql.Null
258 }
259 }()
260 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
261 ctx = rctx // use context from middleware stack in children
262 return obj.DisplayName(), nil
263 })
264 if err != nil {
265 ec.Error(ctx, err)
266 return graphql.Null
267 }
268 if resTmp == nil {
269 if !graphql.HasFieldError(ctx, fc) {
270 ec.Errorf(ctx, "must not be null")
271 }
272 return graphql.Null
273 }
274 res := resTmp.(string)
275 fc.Result = res
276 return ec.marshalNString2string(ctx, field.Selections, res)
277}
278
279func (ec *executionContext) fieldContext_Identity_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
280 fc = &graphql.FieldContext{
281 Object: "Identity",
282 Field: field,
283 IsMethod: true,
284 IsResolver: false,
285 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
286 return nil, errors.New("field of type String does not have child fields")
287 },
288 }
289 return fc, nil
290}
291
292func (ec *executionContext) _Identity_avatarUrl(ctx context.Context, field graphql.CollectedField, obj models.IdentityWrapper) (ret graphql.Marshaler) {
293 fc, err := ec.fieldContext_Identity_avatarUrl(ctx, field)
294 if err != nil {
295 return graphql.Null
296 }
297 ctx = graphql.WithFieldContext(ctx, fc)
298 defer func() {
299 if r := recover(); r != nil {
300 ec.Error(ctx, ec.Recover(ctx, r))
301 ret = graphql.Null
302 }
303 }()
304 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
305 ctx = rctx // use context from middleware stack in children
306 return obj.AvatarUrl()
307 })
308 if err != nil {
309 ec.Error(ctx, err)
310 return graphql.Null
311 }
312 if resTmp == nil {
313 return graphql.Null
314 }
315 res := resTmp.(string)
316 fc.Result = res
317 return ec.marshalOString2string(ctx, field.Selections, res)
318}
319
320func (ec *executionContext) fieldContext_Identity_avatarUrl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
321 fc = &graphql.FieldContext{
322 Object: "Identity",
323 Field: field,
324 IsMethod: true,
325 IsResolver: false,
326 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
327 return nil, errors.New("field of type String does not have child fields")
328 },
329 }
330 return fc, nil
331}
332
333func (ec *executionContext) _Identity_isProtected(ctx context.Context, field graphql.CollectedField, obj models.IdentityWrapper) (ret graphql.Marshaler) {
334 fc, err := ec.fieldContext_Identity_isProtected(ctx, field)
335 if err != nil {
336 return graphql.Null
337 }
338 ctx = graphql.WithFieldContext(ctx, fc)
339 defer func() {
340 if r := recover(); r != nil {
341 ec.Error(ctx, ec.Recover(ctx, r))
342 ret = graphql.Null
343 }
344 }()
345 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
346 ctx = rctx // use context from middleware stack in children
347 return obj.IsProtected()
348 })
349 if err != nil {
350 ec.Error(ctx, err)
351 return graphql.Null
352 }
353 if resTmp == nil {
354 if !graphql.HasFieldError(ctx, fc) {
355 ec.Errorf(ctx, "must not be null")
356 }
357 return graphql.Null
358 }
359 res := resTmp.(bool)
360 fc.Result = res
361 return ec.marshalNBoolean2bool(ctx, field.Selections, res)
362}
363
364func (ec *executionContext) fieldContext_Identity_isProtected(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
365 fc = &graphql.FieldContext{
366 Object: "Identity",
367 Field: field,
368 IsMethod: true,
369 IsResolver: false,
370 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
371 return nil, errors.New("field of type Boolean does not have child fields")
372 },
373 }
374 return fc, nil
375}
376
377func (ec *executionContext) _IdentityConnection_edges(ctx context.Context, field graphql.CollectedField, obj *models.IdentityConnection) (ret graphql.Marshaler) {
378 fc, err := ec.fieldContext_IdentityConnection_edges(ctx, field)
379 if err != nil {
380 return graphql.Null
381 }
382 ctx = graphql.WithFieldContext(ctx, fc)
383 defer func() {
384 if r := recover(); r != nil {
385 ec.Error(ctx, ec.Recover(ctx, r))
386 ret = graphql.Null
387 }
388 }()
389 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
390 ctx = rctx // use context from middleware stack in children
391 return obj.Edges, nil
392 })
393 if err != nil {
394 ec.Error(ctx, err)
395 return graphql.Null
396 }
397 if resTmp == nil {
398 if !graphql.HasFieldError(ctx, fc) {
399 ec.Errorf(ctx, "must not be null")
400 }
401 return graphql.Null
402 }
403 res := resTmp.([]*models.IdentityEdge)
404 fc.Result = res
405 return ec.marshalNIdentityEdge2ᚕᚖgithubᚗcomᚋMichaelMureᚋgitᚑbugᚋapiᚋgraphqlᚋmodelsᚐIdentityEdgeᚄ(ctx, field.Selections, res)
406}
407
408func (ec *executionContext) fieldContext_IdentityConnection_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
409 fc = &graphql.FieldContext{
410 Object: "IdentityConnection",
411 Field: field,
412 IsMethod: false,
413 IsResolver: false,
414 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
415 switch field.Name {
416 case "cursor":
417 return ec.fieldContext_IdentityEdge_cursor(ctx, field)
418 case "node":
419 return ec.fieldContext_IdentityEdge_node(ctx, field)
420 }
421 return nil, fmt.Errorf("no field named %q was found under type IdentityEdge", field.Name)
422 },
423 }
424 return fc, nil
425}
426
427func (ec *executionContext) _IdentityConnection_nodes(ctx context.Context, field graphql.CollectedField, obj *models.IdentityConnection) (ret graphql.Marshaler) {
428 fc, err := ec.fieldContext_IdentityConnection_nodes(ctx, field)
429 if err != nil {
430 return graphql.Null
431 }
432 ctx = graphql.WithFieldContext(ctx, fc)
433 defer func() {
434 if r := recover(); r != nil {
435 ec.Error(ctx, ec.Recover(ctx, r))
436 ret = graphql.Null
437 }
438 }()
439 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
440 ctx = rctx // use context from middleware stack in children
441 return obj.Nodes, nil
442 })
443 if err != nil {
444 ec.Error(ctx, err)
445 return graphql.Null
446 }
447 if resTmp == nil {
448 if !graphql.HasFieldError(ctx, fc) {
449 ec.Errorf(ctx, "must not be null")
450 }
451 return graphql.Null
452 }
453 res := resTmp.([]models.IdentityWrapper)
454 fc.Result = res
455 return ec.marshalNIdentity2ᚕgithubᚗcomᚋMichaelMureᚋgitᚑbugᚋapiᚋgraphqlᚋmodelsᚐIdentityWrapperᚄ(ctx, field.Selections, res)
456}
457
458func (ec *executionContext) fieldContext_IdentityConnection_nodes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
459 fc = &graphql.FieldContext{
460 Object: "IdentityConnection",
461 Field: field,
462 IsMethod: false,
463 IsResolver: false,
464 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
465 switch field.Name {
466 case "id":
467 return ec.fieldContext_Identity_id(ctx, field)
468 case "humanId":
469 return ec.fieldContext_Identity_humanId(ctx, field)
470 case "name":
471 return ec.fieldContext_Identity_name(ctx, field)
472 case "email":
473 return ec.fieldContext_Identity_email(ctx, field)
474 case "login":
475 return ec.fieldContext_Identity_login(ctx, field)
476 case "displayName":
477 return ec.fieldContext_Identity_displayName(ctx, field)
478 case "avatarUrl":
479 return ec.fieldContext_Identity_avatarUrl(ctx, field)
480 case "isProtected":
481 return ec.fieldContext_Identity_isProtected(ctx, field)
482 }
483 return nil, fmt.Errorf("no field named %q was found under type Identity", field.Name)
484 },
485 }
486 return fc, nil
487}
488
489func (ec *executionContext) _IdentityConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *models.IdentityConnection) (ret graphql.Marshaler) {
490 fc, err := ec.fieldContext_IdentityConnection_pageInfo(ctx, field)
491 if err != nil {
492 return graphql.Null
493 }
494 ctx = graphql.WithFieldContext(ctx, fc)
495 defer func() {
496 if r := recover(); r != nil {
497 ec.Error(ctx, ec.Recover(ctx, r))
498 ret = graphql.Null
499 }
500 }()
501 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
502 ctx = rctx // use context from middleware stack in children
503 return obj.PageInfo, nil
504 })
505 if err != nil {
506 ec.Error(ctx, err)
507 return graphql.Null
508 }
509 if resTmp == nil {
510 if !graphql.HasFieldError(ctx, fc) {
511 ec.Errorf(ctx, "must not be null")
512 }
513 return graphql.Null
514 }
515 res := resTmp.(*models.PageInfo)
516 fc.Result = res
517 return ec.marshalNPageInfo2ᚖgithubᚗcomᚋMichaelMureᚋgitᚑbugᚋapiᚋgraphqlᚋmodelsᚐPageInfo(ctx, field.Selections, res)
518}
519
520func (ec *executionContext) fieldContext_IdentityConnection_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
521 fc = &graphql.FieldContext{
522 Object: "IdentityConnection",
523 Field: field,
524 IsMethod: false,
525 IsResolver: false,
526 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
527 switch field.Name {
528 case "hasNextPage":
529 return ec.fieldContext_PageInfo_hasNextPage(ctx, field)
530 case "hasPreviousPage":
531 return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field)
532 case "startCursor":
533 return ec.fieldContext_PageInfo_startCursor(ctx, field)
534 case "endCursor":
535 return ec.fieldContext_PageInfo_endCursor(ctx, field)
536 }
537 return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name)
538 },
539 }
540 return fc, nil
541}
542
543func (ec *executionContext) _IdentityConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *models.IdentityConnection) (ret graphql.Marshaler) {
544 fc, err := ec.fieldContext_IdentityConnection_totalCount(ctx, field)
545 if err != nil {
546 return graphql.Null
547 }
548 ctx = graphql.WithFieldContext(ctx, fc)
549 defer func() {
550 if r := recover(); r != nil {
551 ec.Error(ctx, ec.Recover(ctx, r))
552 ret = graphql.Null
553 }
554 }()
555 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
556 ctx = rctx // use context from middleware stack in children
557 return obj.TotalCount, nil
558 })
559 if err != nil {
560 ec.Error(ctx, err)
561 return graphql.Null
562 }
563 if resTmp == nil {
564 if !graphql.HasFieldError(ctx, fc) {
565 ec.Errorf(ctx, "must not be null")
566 }
567 return graphql.Null
568 }
569 res := resTmp.(int)
570 fc.Result = res
571 return ec.marshalNInt2int(ctx, field.Selections, res)
572}
573
574func (ec *executionContext) fieldContext_IdentityConnection_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
575 fc = &graphql.FieldContext{
576 Object: "IdentityConnection",
577 Field: field,
578 IsMethod: false,
579 IsResolver: false,
580 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
581 return nil, errors.New("field of type Int does not have child fields")
582 },
583 }
584 return fc, nil
585}
586
587func (ec *executionContext) _IdentityEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *models.IdentityEdge) (ret graphql.Marshaler) {
588 fc, err := ec.fieldContext_IdentityEdge_cursor(ctx, field)
589 if err != nil {
590 return graphql.Null
591 }
592 ctx = graphql.WithFieldContext(ctx, fc)
593 defer func() {
594 if r := recover(); r != nil {
595 ec.Error(ctx, ec.Recover(ctx, r))
596 ret = graphql.Null
597 }
598 }()
599 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
600 ctx = rctx // use context from middleware stack in children
601 return obj.Cursor, nil
602 })
603 if err != nil {
604 ec.Error(ctx, err)
605 return graphql.Null
606 }
607 if resTmp == nil {
608 if !graphql.HasFieldError(ctx, fc) {
609 ec.Errorf(ctx, "must not be null")
610 }
611 return graphql.Null
612 }
613 res := resTmp.(string)
614 fc.Result = res
615 return ec.marshalNString2string(ctx, field.Selections, res)
616}
617
618func (ec *executionContext) fieldContext_IdentityEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
619 fc = &graphql.FieldContext{
620 Object: "IdentityEdge",
621 Field: field,
622 IsMethod: false,
623 IsResolver: false,
624 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
625 return nil, errors.New("field of type String does not have child fields")
626 },
627 }
628 return fc, nil
629}
630
631func (ec *executionContext) _IdentityEdge_node(ctx context.Context, field graphql.CollectedField, obj *models.IdentityEdge) (ret graphql.Marshaler) {
632 fc, err := ec.fieldContext_IdentityEdge_node(ctx, field)
633 if err != nil {
634 return graphql.Null
635 }
636 ctx = graphql.WithFieldContext(ctx, fc)
637 defer func() {
638 if r := recover(); r != nil {
639 ec.Error(ctx, ec.Recover(ctx, r))
640 ret = graphql.Null
641 }
642 }()
643 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
644 ctx = rctx // use context from middleware stack in children
645 return obj.Node, nil
646 })
647 if err != nil {
648 ec.Error(ctx, err)
649 return graphql.Null
650 }
651 if resTmp == nil {
652 if !graphql.HasFieldError(ctx, fc) {
653 ec.Errorf(ctx, "must not be null")
654 }
655 return graphql.Null
656 }
657 res := resTmp.(models.IdentityWrapper)
658 fc.Result = res
659 return ec.marshalNIdentity2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋapiᚋgraphqlᚋmodelsᚐIdentityWrapper(ctx, field.Selections, res)
660}
661
662func (ec *executionContext) fieldContext_IdentityEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
663 fc = &graphql.FieldContext{
664 Object: "IdentityEdge",
665 Field: field,
666 IsMethod: false,
667 IsResolver: false,
668 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
669 switch field.Name {
670 case "id":
671 return ec.fieldContext_Identity_id(ctx, field)
672 case "humanId":
673 return ec.fieldContext_Identity_humanId(ctx, field)
674 case "name":
675 return ec.fieldContext_Identity_name(ctx, field)
676 case "email":
677 return ec.fieldContext_Identity_email(ctx, field)
678 case "login":
679 return ec.fieldContext_Identity_login(ctx, field)
680 case "displayName":
681 return ec.fieldContext_Identity_displayName(ctx, field)
682 case "avatarUrl":
683 return ec.fieldContext_Identity_avatarUrl(ctx, field)
684 case "isProtected":
685 return ec.fieldContext_Identity_isProtected(ctx, field)
686 }
687 return nil, fmt.Errorf("no field named %q was found under type Identity", field.Name)
688 },
689 }
690 return fc, nil
691}
692
693// endregion **************************** field.gotpl *****************************
694
695// region **************************** input.gotpl *****************************
696
697// endregion **************************** input.gotpl *****************************
698
699// region ************************** interface.gotpl ***************************
700
701// endregion ************************** interface.gotpl ***************************
702
703// region **************************** object.gotpl ****************************
704
705var identityImplementors = []string{"Identity"}
706
707func (ec *executionContext) _Identity(ctx context.Context, sel ast.SelectionSet, obj models.IdentityWrapper) graphql.Marshaler {
708 fields := graphql.CollectFields(ec.OperationContext, sel, identityImplementors)
709 out := graphql.NewFieldSet(fields)
710 var invalids uint32
711 for i, field := range fields {
712 switch field.Name {
713 case "__typename":
714 out.Values[i] = graphql.MarshalString("Identity")
715 case "id":
716
717 out.Values[i] = ec._Identity_id(ctx, field, obj)
718
719 if out.Values[i] == graphql.Null {
720 atomic.AddUint32(&invalids, 1)
721 }
722 case "humanId":
723 field := field
724
725 innerFunc := func(ctx context.Context) (res graphql.Marshaler) {
726 defer func() {
727 if r := recover(); r != nil {
728 ec.Error(ctx, ec.Recover(ctx, r))
729 }
730 }()
731 res = ec._Identity_humanId(ctx, field, obj)
732 if res == graphql.Null {
733 atomic.AddUint32(&invalids, 1)
734 }
735 return res
736 }
737
738 out.Concurrently(i, func() graphql.Marshaler {
739 return innerFunc(ctx)
740
741 })
742 case "name":
743
744 out.Values[i] = ec._Identity_name(ctx, field, obj)
745
746 case "email":
747
748 out.Values[i] = ec._Identity_email(ctx, field, obj)
749
750 case "login":
751
752 out.Values[i] = ec._Identity_login(ctx, field, obj)
753
754 case "displayName":
755
756 out.Values[i] = ec._Identity_displayName(ctx, field, obj)
757
758 if out.Values[i] == graphql.Null {
759 atomic.AddUint32(&invalids, 1)
760 }
761 case "avatarUrl":
762
763 out.Values[i] = ec._Identity_avatarUrl(ctx, field, obj)
764
765 case "isProtected":
766
767 out.Values[i] = ec._Identity_isProtected(ctx, field, obj)
768
769 if out.Values[i] == graphql.Null {
770 atomic.AddUint32(&invalids, 1)
771 }
772 default:
773 panic("unknown field " + strconv.Quote(field.Name))
774 }
775 }
776 out.Dispatch()
777 if invalids > 0 {
778 return graphql.Null
779 }
780 return out
781}
782
783var identityConnectionImplementors = []string{"IdentityConnection"}
784
785func (ec *executionContext) _IdentityConnection(ctx context.Context, sel ast.SelectionSet, obj *models.IdentityConnection) graphql.Marshaler {
786 fields := graphql.CollectFields(ec.OperationContext, sel, identityConnectionImplementors)
787 out := graphql.NewFieldSet(fields)
788 var invalids uint32
789 for i, field := range fields {
790 switch field.Name {
791 case "__typename":
792 out.Values[i] = graphql.MarshalString("IdentityConnection")
793 case "edges":
794
795 out.Values[i] = ec._IdentityConnection_edges(ctx, field, obj)
796
797 if out.Values[i] == graphql.Null {
798 invalids++
799 }
800 case "nodes":
801
802 out.Values[i] = ec._IdentityConnection_nodes(ctx, field, obj)
803
804 if out.Values[i] == graphql.Null {
805 invalids++
806 }
807 case "pageInfo":
808
809 out.Values[i] = ec._IdentityConnection_pageInfo(ctx, field, obj)
810
811 if out.Values[i] == graphql.Null {
812 invalids++
813 }
814 case "totalCount":
815
816 out.Values[i] = ec._IdentityConnection_totalCount(ctx, field, obj)
817
818 if out.Values[i] == graphql.Null {
819 invalids++
820 }
821 default:
822 panic("unknown field " + strconv.Quote(field.Name))
823 }
824 }
825 out.Dispatch()
826 if invalids > 0 {
827 return graphql.Null
828 }
829 return out
830}
831
832var identityEdgeImplementors = []string{"IdentityEdge"}
833
834func (ec *executionContext) _IdentityEdge(ctx context.Context, sel ast.SelectionSet, obj *models.IdentityEdge) graphql.Marshaler {
835 fields := graphql.CollectFields(ec.OperationContext, sel, identityEdgeImplementors)
836 out := graphql.NewFieldSet(fields)
837 var invalids uint32
838 for i, field := range fields {
839 switch field.Name {
840 case "__typename":
841 out.Values[i] = graphql.MarshalString("IdentityEdge")
842 case "cursor":
843
844 out.Values[i] = ec._IdentityEdge_cursor(ctx, field, obj)
845
846 if out.Values[i] == graphql.Null {
847 invalids++
848 }
849 case "node":
850
851 out.Values[i] = ec._IdentityEdge_node(ctx, field, obj)
852
853 if out.Values[i] == graphql.Null {
854 invalids++
855 }
856 default:
857 panic("unknown field " + strconv.Quote(field.Name))
858 }
859 }
860 out.Dispatch()
861 if invalids > 0 {
862 return graphql.Null
863 }
864 return out
865}
866
867// endregion **************************** object.gotpl ****************************
868
869// region ***************************** type.gotpl *****************************
870
871func (ec *executionContext) marshalNIdentity2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋapiᚋgraphqlᚋmodelsᚐIdentityWrapper(ctx context.Context, sel ast.SelectionSet, v models.IdentityWrapper) graphql.Marshaler {
872 if v == nil {
873 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
874 ec.Errorf(ctx, "the requested element is null which the schema does not allow")
875 }
876 return graphql.Null
877 }
878 return ec._Identity(ctx, sel, v)
879}
880
881func (ec *executionContext) marshalNIdentity2ᚕgithubᚗcomᚋMichaelMureᚋgitᚑbugᚋapiᚋgraphqlᚋmodelsᚐIdentityWrapperᚄ(ctx context.Context, sel ast.SelectionSet, v []models.IdentityWrapper) graphql.Marshaler {
882 ret := make(graphql.Array, len(v))
883 var wg sync.WaitGroup
884 isLen1 := len(v) == 1
885 if !isLen1 {
886 wg.Add(len(v))
887 }
888 for i := range v {
889 i := i
890 fc := &graphql.FieldContext{
891 Index: &i,
892 Result: &v[i],
893 }
894 ctx := graphql.WithFieldContext(ctx, fc)
895 f := func(i int) {
896 defer func() {
897 if r := recover(); r != nil {
898 ec.Error(ctx, ec.Recover(ctx, r))
899 ret = nil
900 }
901 }()
902 if !isLen1 {
903 defer wg.Done()
904 }
905 ret[i] = ec.marshalNIdentity2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋapiᚋgraphqlᚋmodelsᚐIdentityWrapper(ctx, sel, v[i])
906 }
907 if isLen1 {
908 f(i)
909 } else {
910 go f(i)
911 }
912
913 }
914 wg.Wait()
915
916 for _, e := range ret {
917 if e == graphql.Null {
918 return graphql.Null
919 }
920 }
921
922 return ret
923}
924
925func (ec *executionContext) marshalNIdentityConnection2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋapiᚋgraphqlᚋmodelsᚐIdentityConnection(ctx context.Context, sel ast.SelectionSet, v models.IdentityConnection) graphql.Marshaler {
926 return ec._IdentityConnection(ctx, sel, &v)
927}
928
929func (ec *executionContext) marshalNIdentityConnection2ᚖgithubᚗcomᚋMichaelMureᚋgitᚑbugᚋapiᚋgraphqlᚋmodelsᚐIdentityConnection(ctx context.Context, sel ast.SelectionSet, v *models.IdentityConnection) graphql.Marshaler {
930 if v == nil {
931 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
932 ec.Errorf(ctx, "the requested element is null which the schema does not allow")
933 }
934 return graphql.Null
935 }
936 return ec._IdentityConnection(ctx, sel, v)
937}
938
939func (ec *executionContext) marshalNIdentityEdge2ᚕᚖgithubᚗcomᚋMichaelMureᚋgitᚑbugᚋapiᚋgraphqlᚋmodelsᚐIdentityEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*models.IdentityEdge) graphql.Marshaler {
940 ret := make(graphql.Array, len(v))
941 var wg sync.WaitGroup
942 isLen1 := len(v) == 1
943 if !isLen1 {
944 wg.Add(len(v))
945 }
946 for i := range v {
947 i := i
948 fc := &graphql.FieldContext{
949 Index: &i,
950 Result: &v[i],
951 }
952 ctx := graphql.WithFieldContext(ctx, fc)
953 f := func(i int) {
954 defer func() {
955 if r := recover(); r != nil {
956 ec.Error(ctx, ec.Recover(ctx, r))
957 ret = nil
958 }
959 }()
960 if !isLen1 {
961 defer wg.Done()
962 }
963 ret[i] = ec.marshalNIdentityEdge2ᚖgithubᚗcomᚋMichaelMureᚋgitᚑbugᚋapiᚋgraphqlᚋmodelsᚐIdentityEdge(ctx, sel, v[i])
964 }
965 if isLen1 {
966 f(i)
967 } else {
968 go f(i)
969 }
970
971 }
972 wg.Wait()
973
974 for _, e := range ret {
975 if e == graphql.Null {
976 return graphql.Null
977 }
978 }
979
980 return ret
981}
982
983func (ec *executionContext) marshalNIdentityEdge2ᚖgithubᚗcomᚋMichaelMureᚋgitᚑbugᚋapiᚋgraphqlᚋmodelsᚐIdentityEdge(ctx context.Context, sel ast.SelectionSet, v *models.IdentityEdge) graphql.Marshaler {
984 if v == nil {
985 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
986 ec.Errorf(ctx, "the requested element is null which the schema does not allow")
987 }
988 return graphql.Null
989 }
990 return ec._IdentityEdge(ctx, sel, v)
991}
992
993func (ec *executionContext) marshalOIdentity2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋapiᚋgraphqlᚋmodelsᚐIdentityWrapper(ctx context.Context, sel ast.SelectionSet, v models.IdentityWrapper) graphql.Marshaler {
994 if v == nil {
995 return graphql.Null
996 }
997 return ec._Identity(ctx, sel, v)
998}
999
1000// endregion ***************************** type.gotpl *****************************