1// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
2
3package graph
4
5import (
6 "context"
7 "errors"
8 "fmt"
9 "io"
10 "strconv"
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/cache"
16 "github.com/vektah/gqlparser/v2/ast"
17)
18
19// region ************************** generated!.gotpl **************************
20
21type SubscriptionResolver interface {
22 AllEvents(ctx context.Context, repoRef *string, typename *string) (<-chan *models.EntityEvent, error)
23 IdentityEvents(ctx context.Context, repoRef *string) (<-chan *models.IdentityEvent, error)
24 BugEvents(ctx context.Context, repoRef *string) (<-chan *models.BugEvent, error)
25}
26
27// endregion ************************** generated!.gotpl **************************
28
29// region ***************************** args.gotpl *****************************
30
31func (ec *executionContext) field_Subscription_allEvents_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
32 var err error
33 args := map[string]any{}
34 arg0, err := ec.field_Subscription_allEvents_argsRepoRef(ctx, rawArgs)
35 if err != nil {
36 return nil, err
37 }
38 args["repoRef"] = arg0
39 arg1, err := ec.field_Subscription_allEvents_argsTypename(ctx, rawArgs)
40 if err != nil {
41 return nil, err
42 }
43 args["typename"] = arg1
44 return args, nil
45}
46func (ec *executionContext) field_Subscription_allEvents_argsRepoRef(
47 ctx context.Context,
48 rawArgs map[string]any,
49) (*string, error) {
50 if _, ok := rawArgs["repoRef"]; !ok {
51 var zeroVal *string
52 return zeroVal, nil
53 }
54
55 ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("repoRef"))
56 if tmp, ok := rawArgs["repoRef"]; ok {
57 return ec.unmarshalOString2ástring(ctx, tmp)
58 }
59
60 var zeroVal *string
61 return zeroVal, nil
62}
63
64func (ec *executionContext) field_Subscription_allEvents_argsTypename(
65 ctx context.Context,
66 rawArgs map[string]any,
67) (*string, error) {
68 if _, ok := rawArgs["typename"]; !ok {
69 var zeroVal *string
70 return zeroVal, nil
71 }
72
73 ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("typename"))
74 if tmp, ok := rawArgs["typename"]; ok {
75 return ec.unmarshalOString2ástring(ctx, tmp)
76 }
77
78 var zeroVal *string
79 return zeroVal, nil
80}
81
82func (ec *executionContext) field_Subscription_bugEvents_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
83 var err error
84 args := map[string]any{}
85 arg0, err := ec.field_Subscription_bugEvents_argsRepoRef(ctx, rawArgs)
86 if err != nil {
87 return nil, err
88 }
89 args["repoRef"] = arg0
90 return args, nil
91}
92func (ec *executionContext) field_Subscription_bugEvents_argsRepoRef(
93 ctx context.Context,
94 rawArgs map[string]any,
95) (*string, error) {
96 if _, ok := rawArgs["repoRef"]; !ok {
97 var zeroVal *string
98 return zeroVal, nil
99 }
100
101 ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("repoRef"))
102 if tmp, ok := rawArgs["repoRef"]; ok {
103 return ec.unmarshalOString2ástring(ctx, tmp)
104 }
105
106 var zeroVal *string
107 return zeroVal, nil
108}
109
110func (ec *executionContext) field_Subscription_identityEvents_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
111 var err error
112 args := map[string]any{}
113 arg0, err := ec.field_Subscription_identityEvents_argsRepoRef(ctx, rawArgs)
114 if err != nil {
115 return nil, err
116 }
117 args["repoRef"] = arg0
118 return args, nil
119}
120func (ec *executionContext) field_Subscription_identityEvents_argsRepoRef(
121 ctx context.Context,
122 rawArgs map[string]any,
123) (*string, error) {
124 if _, ok := rawArgs["repoRef"]; !ok {
125 var zeroVal *string
126 return zeroVal, nil
127 }
128
129 ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("repoRef"))
130 if tmp, ok := rawArgs["repoRef"]; ok {
131 return ec.unmarshalOString2ástring(ctx, tmp)
132 }
133
134 var zeroVal *string
135 return zeroVal, nil
136}
137
138// endregion ***************************** args.gotpl *****************************
139
140// region ************************** directives.gotpl **************************
141
142// endregion ************************** directives.gotpl **************************
143
144// region **************************** field.gotpl *****************************
145
146func (ec *executionContext) _BugEvent_type(ctx context.Context, field graphql.CollectedField, obj *models.BugEvent) (ret graphql.Marshaler) {
147 fc, err := ec.fieldContext_BugEvent_type(ctx, field)
148 if err != nil {
149 return graphql.Null
150 }
151 ctx = graphql.WithFieldContext(ctx, fc)
152 defer func() {
153 if r := recover(); r != nil {
154 ec.Error(ctx, ec.Recover(ctx, r))
155 ret = graphql.Null
156 }
157 }()
158 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
159 ctx = rctx // use context from middleware stack in children
160 return obj.Type, nil
161 })
162 if err != nil {
163 ec.Error(ctx, err)
164 return graphql.Null
165 }
166 if resTmp == nil {
167 if !graphql.HasFieldError(ctx, fc) {
168 ec.Errorf(ctx, "must not be null")
169 }
170 return graphql.Null
171 }
172 res := resTmp.(cache.EntityEventType)
173 fc.Result = res
174 return ec.marshalNEntityEventType2githubácomágitábugágitábugácacheáEntityEventType(ctx, field.Selections, res)
175}
176
177func (ec *executionContext) fieldContext_BugEvent_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
178 fc = &graphql.FieldContext{
179 Object: "BugEvent",
180 Field: field,
181 IsMethod: false,
182 IsResolver: false,
183 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
184 return nil, errors.New("field of type EntityEventType does not have child fields")
185 },
186 }
187 return fc, nil
188}
189
190func (ec *executionContext) _BugEvent_bug(ctx context.Context, field graphql.CollectedField, obj *models.BugEvent) (ret graphql.Marshaler) {
191 fc, err := ec.fieldContext_BugEvent_bug(ctx, field)
192 if err != nil {
193 return graphql.Null
194 }
195 ctx = graphql.WithFieldContext(ctx, fc)
196 defer func() {
197 if r := recover(); r != nil {
198 ec.Error(ctx, ec.Recover(ctx, r))
199 ret = graphql.Null
200 }
201 }()
202 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
203 ctx = rctx // use context from middleware stack in children
204 return obj.Bug, nil
205 })
206 if err != nil {
207 ec.Error(ctx, err)
208 return graphql.Null
209 }
210 if resTmp == nil {
211 if !graphql.HasFieldError(ctx, fc) {
212 ec.Errorf(ctx, "must not be null")
213 }
214 return graphql.Null
215 }
216 res := resTmp.(models.BugWrapper)
217 fc.Result = res
218 return ec.marshalNBug2githubácomágitábugágitábugáapiágraphqlámodelsáBugWrapper(ctx, field.Selections, res)
219}
220
221func (ec *executionContext) fieldContext_BugEvent_bug(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
222 fc = &graphql.FieldContext{
223 Object: "BugEvent",
224 Field: field,
225 IsMethod: false,
226 IsResolver: false,
227 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
228 switch field.Name {
229 case "id":
230 return ec.fieldContext_Bug_id(ctx, field)
231 case "humanId":
232 return ec.fieldContext_Bug_humanId(ctx, field)
233 case "status":
234 return ec.fieldContext_Bug_status(ctx, field)
235 case "title":
236 return ec.fieldContext_Bug_title(ctx, field)
237 case "labels":
238 return ec.fieldContext_Bug_labels(ctx, field)
239 case "author":
240 return ec.fieldContext_Bug_author(ctx, field)
241 case "createdAt":
242 return ec.fieldContext_Bug_createdAt(ctx, field)
243 case "lastEdit":
244 return ec.fieldContext_Bug_lastEdit(ctx, field)
245 case "actors":
246 return ec.fieldContext_Bug_actors(ctx, field)
247 case "participants":
248 return ec.fieldContext_Bug_participants(ctx, field)
249 case "comments":
250 return ec.fieldContext_Bug_comments(ctx, field)
251 case "timeline":
252 return ec.fieldContext_Bug_timeline(ctx, field)
253 case "operations":
254 return ec.fieldContext_Bug_operations(ctx, field)
255 }
256 return nil, fmt.Errorf("no field named %q was found under type Bug", field.Name)
257 },
258 }
259 return fc, nil
260}
261
262func (ec *executionContext) _EntityEvent_type(ctx context.Context, field graphql.CollectedField, obj *models.EntityEvent) (ret graphql.Marshaler) {
263 fc, err := ec.fieldContext_EntityEvent_type(ctx, field)
264 if err != nil {
265 return graphql.Null
266 }
267 ctx = graphql.WithFieldContext(ctx, fc)
268 defer func() {
269 if r := recover(); r != nil {
270 ec.Error(ctx, ec.Recover(ctx, r))
271 ret = graphql.Null
272 }
273 }()
274 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
275 ctx = rctx // use context from middleware stack in children
276 return obj.Type, nil
277 })
278 if err != nil {
279 ec.Error(ctx, err)
280 return graphql.Null
281 }
282 if resTmp == nil {
283 if !graphql.HasFieldError(ctx, fc) {
284 ec.Errorf(ctx, "must not be null")
285 }
286 return graphql.Null
287 }
288 res := resTmp.(cache.EntityEventType)
289 fc.Result = res
290 return ec.marshalNEntityEventType2githubácomágitábugágitábugácacheáEntityEventType(ctx, field.Selections, res)
291}
292
293func (ec *executionContext) fieldContext_EntityEvent_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
294 fc = &graphql.FieldContext{
295 Object: "EntityEvent",
296 Field: field,
297 IsMethod: false,
298 IsResolver: false,
299 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
300 return nil, errors.New("field of type EntityEventType does not have child fields")
301 },
302 }
303 return fc, nil
304}
305
306func (ec *executionContext) _EntityEvent_entity(ctx context.Context, field graphql.CollectedField, obj *models.EntityEvent) (ret graphql.Marshaler) {
307 fc, err := ec.fieldContext_EntityEvent_entity(ctx, field)
308 if err != nil {
309 return graphql.Null
310 }
311 ctx = graphql.WithFieldContext(ctx, fc)
312 defer func() {
313 if r := recover(); r != nil {
314 ec.Error(ctx, ec.Recover(ctx, r))
315 ret = graphql.Null
316 }
317 }()
318 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
319 ctx = rctx // use context from middleware stack in children
320 return obj.Entity, nil
321 })
322 if err != nil {
323 ec.Error(ctx, err)
324 return graphql.Null
325 }
326 if resTmp == nil {
327 return graphql.Null
328 }
329 res := resTmp.(models.Entity)
330 fc.Result = res
331 return ec.marshalOEntity2githubácomágitábugágitábugáapiágraphqlámodelsáEntity(ctx, field.Selections, res)
332}
333
334func (ec *executionContext) fieldContext_EntityEvent_entity(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
335 fc = &graphql.FieldContext{
336 Object: "EntityEvent",
337 Field: field,
338 IsMethod: false,
339 IsResolver: false,
340 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
341 return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE")
342 },
343 }
344 return fc, nil
345}
346
347func (ec *executionContext) _IdentityEvent_type(ctx context.Context, field graphql.CollectedField, obj *models.IdentityEvent) (ret graphql.Marshaler) {
348 fc, err := ec.fieldContext_IdentityEvent_type(ctx, field)
349 if err != nil {
350 return graphql.Null
351 }
352 ctx = graphql.WithFieldContext(ctx, fc)
353 defer func() {
354 if r := recover(); r != nil {
355 ec.Error(ctx, ec.Recover(ctx, r))
356 ret = graphql.Null
357 }
358 }()
359 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
360 ctx = rctx // use context from middleware stack in children
361 return obj.Type, nil
362 })
363 if err != nil {
364 ec.Error(ctx, err)
365 return graphql.Null
366 }
367 if resTmp == nil {
368 if !graphql.HasFieldError(ctx, fc) {
369 ec.Errorf(ctx, "must not be null")
370 }
371 return graphql.Null
372 }
373 res := resTmp.(cache.EntityEventType)
374 fc.Result = res
375 return ec.marshalNEntityEventType2githubácomágitábugágitábugácacheáEntityEventType(ctx, field.Selections, res)
376}
377
378func (ec *executionContext) fieldContext_IdentityEvent_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
379 fc = &graphql.FieldContext{
380 Object: "IdentityEvent",
381 Field: field,
382 IsMethod: false,
383 IsResolver: false,
384 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
385 return nil, errors.New("field of type EntityEventType does not have child fields")
386 },
387 }
388 return fc, nil
389}
390
391func (ec *executionContext) _IdentityEvent_identity(ctx context.Context, field graphql.CollectedField, obj *models.IdentityEvent) (ret graphql.Marshaler) {
392 fc, err := ec.fieldContext_IdentityEvent_identity(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) (any, error) {
404 ctx = rctx // use context from middleware stack in children
405 return obj.Identity, 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.(models.IdentityWrapper)
418 fc.Result = res
419 return ec.marshalNIdentity2githubácomágitábugágitábugáapiágraphqlámodelsáIdentityWrapper(ctx, field.Selections, res)
420}
421
422func (ec *executionContext) fieldContext_IdentityEvent_identity(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
423 fc = &graphql.FieldContext{
424 Object: "IdentityEvent",
425 Field: field,
426 IsMethod: false,
427 IsResolver: false,
428 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
429 switch field.Name {
430 case "id":
431 return ec.fieldContext_Identity_id(ctx, field)
432 case "humanId":
433 return ec.fieldContext_Identity_humanId(ctx, field)
434 case "name":
435 return ec.fieldContext_Identity_name(ctx, field)
436 case "email":
437 return ec.fieldContext_Identity_email(ctx, field)
438 case "login":
439 return ec.fieldContext_Identity_login(ctx, field)
440 case "displayName":
441 return ec.fieldContext_Identity_displayName(ctx, field)
442 case "avatarUrl":
443 return ec.fieldContext_Identity_avatarUrl(ctx, field)
444 case "isProtected":
445 return ec.fieldContext_Identity_isProtected(ctx, field)
446 }
447 return nil, fmt.Errorf("no field named %q was found under type Identity", field.Name)
448 },
449 }
450 return fc, nil
451}
452
453func (ec *executionContext) _Subscription_allEvents(ctx context.Context, field graphql.CollectedField) (ret func(ctx context.Context) graphql.Marshaler) {
454 fc, err := ec.fieldContext_Subscription_allEvents(ctx, field)
455 if err != nil {
456 return nil
457 }
458 ctx = graphql.WithFieldContext(ctx, fc)
459 defer func() {
460 if r := recover(); r != nil {
461 ec.Error(ctx, ec.Recover(ctx, r))
462 ret = nil
463 }
464 }()
465 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
466 ctx = rctx // use context from middleware stack in children
467 return ec.resolvers.Subscription().AllEvents(rctx, fc.Args["repoRef"].(*string), fc.Args["typename"].(*string))
468 })
469 if err != nil {
470 ec.Error(ctx, err)
471 return nil
472 }
473 if resTmp == nil {
474 if !graphql.HasFieldError(ctx, fc) {
475 ec.Errorf(ctx, "must not be null")
476 }
477 return nil
478 }
479 return func(ctx context.Context) graphql.Marshaler {
480 select {
481 case res, ok := <-resTmp.(<-chan *models.EntityEvent):
482 if !ok {
483 return nil
484 }
485 return graphql.WriterFunc(func(w io.Writer) {
486 w.Write([]byte{'{'})
487 graphql.MarshalString(field.Alias).MarshalGQL(w)
488 w.Write([]byte{':'})
489 ec.marshalNEntityEvent2ágithubácomágitábugágitábugáapiágraphqlámodelsáEntityEvent(ctx, field.Selections, res).MarshalGQL(w)
490 w.Write([]byte{'}'})
491 })
492 case <-ctx.Done():
493 return nil
494 }
495 }
496}
497
498func (ec *executionContext) fieldContext_Subscription_allEvents(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
499 fc = &graphql.FieldContext{
500 Object: "Subscription",
501 Field: field,
502 IsMethod: true,
503 IsResolver: true,
504 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
505 switch field.Name {
506 case "type":
507 return ec.fieldContext_EntityEvent_type(ctx, field)
508 case "entity":
509 return ec.fieldContext_EntityEvent_entity(ctx, field)
510 }
511 return nil, fmt.Errorf("no field named %q was found under type EntityEvent", field.Name)
512 },
513 }
514 defer func() {
515 if r := recover(); r != nil {
516 err = ec.Recover(ctx, r)
517 ec.Error(ctx, err)
518 }
519 }()
520 ctx = graphql.WithFieldContext(ctx, fc)
521 if fc.Args, err = ec.field_Subscription_allEvents_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
522 ec.Error(ctx, err)
523 return fc, err
524 }
525 return fc, nil
526}
527
528func (ec *executionContext) _Subscription_identityEvents(ctx context.Context, field graphql.CollectedField) (ret func(ctx context.Context) graphql.Marshaler) {
529 fc, err := ec.fieldContext_Subscription_identityEvents(ctx, field)
530 if err != nil {
531 return nil
532 }
533 ctx = graphql.WithFieldContext(ctx, fc)
534 defer func() {
535 if r := recover(); r != nil {
536 ec.Error(ctx, ec.Recover(ctx, r))
537 ret = nil
538 }
539 }()
540 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
541 ctx = rctx // use context from middleware stack in children
542 return ec.resolvers.Subscription().IdentityEvents(rctx, fc.Args["repoRef"].(*string))
543 })
544 if err != nil {
545 ec.Error(ctx, err)
546 return nil
547 }
548 if resTmp == nil {
549 if !graphql.HasFieldError(ctx, fc) {
550 ec.Errorf(ctx, "must not be null")
551 }
552 return nil
553 }
554 return func(ctx context.Context) graphql.Marshaler {
555 select {
556 case res, ok := <-resTmp.(<-chan *models.IdentityEvent):
557 if !ok {
558 return nil
559 }
560 return graphql.WriterFunc(func(w io.Writer) {
561 w.Write([]byte{'{'})
562 graphql.MarshalString(field.Alias).MarshalGQL(w)
563 w.Write([]byte{':'})
564 ec.marshalNIdentityEvent2ágithubácomágitábugágitábugáapiágraphqlámodelsáIdentityEvent(ctx, field.Selections, res).MarshalGQL(w)
565 w.Write([]byte{'}'})
566 })
567 case <-ctx.Done():
568 return nil
569 }
570 }
571}
572
573func (ec *executionContext) fieldContext_Subscription_identityEvents(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
574 fc = &graphql.FieldContext{
575 Object: "Subscription",
576 Field: field,
577 IsMethod: true,
578 IsResolver: true,
579 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
580 switch field.Name {
581 case "type":
582 return ec.fieldContext_IdentityEvent_type(ctx, field)
583 case "identity":
584 return ec.fieldContext_IdentityEvent_identity(ctx, field)
585 }
586 return nil, fmt.Errorf("no field named %q was found under type IdentityEvent", field.Name)
587 },
588 }
589 defer func() {
590 if r := recover(); r != nil {
591 err = ec.Recover(ctx, r)
592 ec.Error(ctx, err)
593 }
594 }()
595 ctx = graphql.WithFieldContext(ctx, fc)
596 if fc.Args, err = ec.field_Subscription_identityEvents_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
597 ec.Error(ctx, err)
598 return fc, err
599 }
600 return fc, nil
601}
602
603func (ec *executionContext) _Subscription_bugEvents(ctx context.Context, field graphql.CollectedField) (ret func(ctx context.Context) graphql.Marshaler) {
604 fc, err := ec.fieldContext_Subscription_bugEvents(ctx, field)
605 if err != nil {
606 return nil
607 }
608 ctx = graphql.WithFieldContext(ctx, fc)
609 defer func() {
610 if r := recover(); r != nil {
611 ec.Error(ctx, ec.Recover(ctx, r))
612 ret = nil
613 }
614 }()
615 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
616 ctx = rctx // use context from middleware stack in children
617 return ec.resolvers.Subscription().BugEvents(rctx, fc.Args["repoRef"].(*string))
618 })
619 if err != nil {
620 ec.Error(ctx, err)
621 return nil
622 }
623 if resTmp == nil {
624 if !graphql.HasFieldError(ctx, fc) {
625 ec.Errorf(ctx, "must not be null")
626 }
627 return nil
628 }
629 return func(ctx context.Context) graphql.Marshaler {
630 select {
631 case res, ok := <-resTmp.(<-chan *models.BugEvent):
632 if !ok {
633 return nil
634 }
635 return graphql.WriterFunc(func(w io.Writer) {
636 w.Write([]byte{'{'})
637 graphql.MarshalString(field.Alias).MarshalGQL(w)
638 w.Write([]byte{':'})
639 ec.marshalNBugEvent2ágithubácomágitábugágitábugáapiágraphqlámodelsáBugEvent(ctx, field.Selections, res).MarshalGQL(w)
640 w.Write([]byte{'}'})
641 })
642 case <-ctx.Done():
643 return nil
644 }
645 }
646}
647
648func (ec *executionContext) fieldContext_Subscription_bugEvents(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
649 fc = &graphql.FieldContext{
650 Object: "Subscription",
651 Field: field,
652 IsMethod: true,
653 IsResolver: true,
654 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
655 switch field.Name {
656 case "type":
657 return ec.fieldContext_BugEvent_type(ctx, field)
658 case "bug":
659 return ec.fieldContext_BugEvent_bug(ctx, field)
660 }
661 return nil, fmt.Errorf("no field named %q was found under type BugEvent", field.Name)
662 },
663 }
664 defer func() {
665 if r := recover(); r != nil {
666 err = ec.Recover(ctx, r)
667 ec.Error(ctx, err)
668 }
669 }()
670 ctx = graphql.WithFieldContext(ctx, fc)
671 if fc.Args, err = ec.field_Subscription_bugEvents_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
672 ec.Error(ctx, err)
673 return fc, err
674 }
675 return fc, nil
676}
677
678// endregion **************************** field.gotpl *****************************
679
680// region **************************** input.gotpl *****************************
681
682// endregion **************************** input.gotpl *****************************
683
684// region ************************** interface.gotpl ***************************
685
686// endregion ************************** interface.gotpl ***************************
687
688// region **************************** object.gotpl ****************************
689
690var bugEventImplementors = []string{"BugEvent"}
691
692func (ec *executionContext) _BugEvent(ctx context.Context, sel ast.SelectionSet, obj *models.BugEvent) graphql.Marshaler {
693 fields := graphql.CollectFields(ec.OperationContext, sel, bugEventImplementors)
694
695 out := graphql.NewFieldSet(fields)
696 deferred := make(map[string]*graphql.FieldSet)
697 for i, field := range fields {
698 switch field.Name {
699 case "__typename":
700 out.Values[i] = graphql.MarshalString("BugEvent")
701 case "type":
702 out.Values[i] = ec._BugEvent_type(ctx, field, obj)
703 if out.Values[i] == graphql.Null {
704 out.Invalids++
705 }
706 case "bug":
707 out.Values[i] = ec._BugEvent_bug(ctx, field, obj)
708 if out.Values[i] == graphql.Null {
709 out.Invalids++
710 }
711 default:
712 panic("unknown field " + strconv.Quote(field.Name))
713 }
714 }
715 out.Dispatch(ctx)
716 if out.Invalids > 0 {
717 return graphql.Null
718 }
719
720 atomic.AddInt32(&ec.deferred, int32(len(deferred)))
721
722 for label, dfs := range deferred {
723 ec.processDeferredGroup(graphql.DeferredGroup{
724 Label: label,
725 Path: graphql.GetPath(ctx),
726 FieldSet: dfs,
727 Context: ctx,
728 })
729 }
730
731 return out
732}
733
734var entityEventImplementors = []string{"EntityEvent"}
735
736func (ec *executionContext) _EntityEvent(ctx context.Context, sel ast.SelectionSet, obj *models.EntityEvent) graphql.Marshaler {
737 fields := graphql.CollectFields(ec.OperationContext, sel, entityEventImplementors)
738
739 out := graphql.NewFieldSet(fields)
740 deferred := make(map[string]*graphql.FieldSet)
741 for i, field := range fields {
742 switch field.Name {
743 case "__typename":
744 out.Values[i] = graphql.MarshalString("EntityEvent")
745 case "type":
746 out.Values[i] = ec._EntityEvent_type(ctx, field, obj)
747 if out.Values[i] == graphql.Null {
748 out.Invalids++
749 }
750 case "entity":
751 out.Values[i] = ec._EntityEvent_entity(ctx, field, obj)
752 default:
753 panic("unknown field " + strconv.Quote(field.Name))
754 }
755 }
756 out.Dispatch(ctx)
757 if out.Invalids > 0 {
758 return graphql.Null
759 }
760
761 atomic.AddInt32(&ec.deferred, int32(len(deferred)))
762
763 for label, dfs := range deferred {
764 ec.processDeferredGroup(graphql.DeferredGroup{
765 Label: label,
766 Path: graphql.GetPath(ctx),
767 FieldSet: dfs,
768 Context: ctx,
769 })
770 }
771
772 return out
773}
774
775var identityEventImplementors = []string{"IdentityEvent"}
776
777func (ec *executionContext) _IdentityEvent(ctx context.Context, sel ast.SelectionSet, obj *models.IdentityEvent) graphql.Marshaler {
778 fields := graphql.CollectFields(ec.OperationContext, sel, identityEventImplementors)
779
780 out := graphql.NewFieldSet(fields)
781 deferred := make(map[string]*graphql.FieldSet)
782 for i, field := range fields {
783 switch field.Name {
784 case "__typename":
785 out.Values[i] = graphql.MarshalString("IdentityEvent")
786 case "type":
787 out.Values[i] = ec._IdentityEvent_type(ctx, field, obj)
788 if out.Values[i] == graphql.Null {
789 out.Invalids++
790 }
791 case "identity":
792 out.Values[i] = ec._IdentityEvent_identity(ctx, field, obj)
793 if out.Values[i] == graphql.Null {
794 out.Invalids++
795 }
796 default:
797 panic("unknown field " + strconv.Quote(field.Name))
798 }
799 }
800 out.Dispatch(ctx)
801 if out.Invalids > 0 {
802 return graphql.Null
803 }
804
805 atomic.AddInt32(&ec.deferred, int32(len(deferred)))
806
807 for label, dfs := range deferred {
808 ec.processDeferredGroup(graphql.DeferredGroup{
809 Label: label,
810 Path: graphql.GetPath(ctx),
811 FieldSet: dfs,
812 Context: ctx,
813 })
814 }
815
816 return out
817}
818
819var subscriptionImplementors = []string{"Subscription"}
820
821func (ec *executionContext) _Subscription(ctx context.Context, sel ast.SelectionSet) func(ctx context.Context) graphql.Marshaler {
822 fields := graphql.CollectFields(ec.OperationContext, sel, subscriptionImplementors)
823 ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
824 Object: "Subscription",
825 })
826 if len(fields) != 1 {
827 ec.Errorf(ctx, "must subscribe to exactly one stream")
828 return nil
829 }
830
831 switch fields[0].Name {
832 case "allEvents":
833 return ec._Subscription_allEvents(ctx, fields[0])
834 case "identityEvents":
835 return ec._Subscription_identityEvents(ctx, fields[0])
836 case "bugEvents":
837 return ec._Subscription_bugEvents(ctx, fields[0])
838 default:
839 panic("unknown field " + strconv.Quote(fields[0].Name))
840 }
841}
842
843// endregion **************************** object.gotpl ****************************
844
845// region ***************************** type.gotpl *****************************
846
847func (ec *executionContext) marshalNBugEvent2githubácomágitábugágitábugáapiágraphqlámodelsáBugEvent(ctx context.Context, sel ast.SelectionSet, v models.BugEvent) graphql.Marshaler {
848 return ec._BugEvent(ctx, sel, &v)
849}
850
851func (ec *executionContext) marshalNBugEvent2ágithubácomágitábugágitábugáapiágraphqlámodelsáBugEvent(ctx context.Context, sel ast.SelectionSet, v *models.BugEvent) graphql.Marshaler {
852 if v == nil {
853 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
854 ec.Errorf(ctx, "the requested element is null which the schema does not allow")
855 }
856 return graphql.Null
857 }
858 return ec._BugEvent(ctx, sel, v)
859}
860
861func (ec *executionContext) marshalNEntityEvent2githubácomágitábugágitábugáapiágraphqlámodelsáEntityEvent(ctx context.Context, sel ast.SelectionSet, v models.EntityEvent) graphql.Marshaler {
862 return ec._EntityEvent(ctx, sel, &v)
863}
864
865func (ec *executionContext) marshalNEntityEvent2ágithubácomágitábugágitábugáapiágraphqlámodelsáEntityEvent(ctx context.Context, sel ast.SelectionSet, v *models.EntityEvent) graphql.Marshaler {
866 if v == nil {
867 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
868 ec.Errorf(ctx, "the requested element is null which the schema does not allow")
869 }
870 return graphql.Null
871 }
872 return ec._EntityEvent(ctx, sel, v)
873}
874
875func (ec *executionContext) unmarshalNEntityEventType2githubácomágitábugágitábugácacheáEntityEventType(ctx context.Context, v any) (cache.EntityEventType, error) {
876 var res cache.EntityEventType
877 err := res.UnmarshalGQL(v)
878 return res, graphql.ErrorOnPath(ctx, err)
879}
880
881func (ec *executionContext) marshalNEntityEventType2githubácomágitábugágitábugácacheáEntityEventType(ctx context.Context, sel ast.SelectionSet, v cache.EntityEventType) graphql.Marshaler {
882 return v
883}
884
885func (ec *executionContext) marshalNIdentityEvent2githubácomágitábugágitábugáapiágraphqlámodelsáIdentityEvent(ctx context.Context, sel ast.SelectionSet, v models.IdentityEvent) graphql.Marshaler {
886 return ec._IdentityEvent(ctx, sel, &v)
887}
888
889func (ec *executionContext) marshalNIdentityEvent2ágithubácomágitábugágitábugáapiágraphqlámodelsáIdentityEvent(ctx context.Context, sel ast.SelectionSet, v *models.IdentityEvent) graphql.Marshaler {
890 if v == nil {
891 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
892 ec.Errorf(ctx, "the requested element is null which the schema does not allow")
893 }
894 return graphql.Null
895 }
896 return ec._IdentityEvent(ctx, sel, v)
897}
898
899// endregion ***************************** type.gotpl *****************************