1// Code generated by github.com/vektah/gqlgen, DO NOT EDIT.
2
3package graph
4
5import (
6 "bytes"
7 context "context"
8 fmt "fmt"
9 strconv "strconv"
10 time "time"
11
12 bug "github.com/MichaelMure/git-bug/bug"
13 operations "github.com/MichaelMure/git-bug/bug/operations"
14 models "github.com/MichaelMure/git-bug/graphql/models"
15 util "github.com/MichaelMure/git-bug/util"
16 graphql "github.com/vektah/gqlgen/graphql"
17 introspection "github.com/vektah/gqlgen/neelance/introspection"
18 query "github.com/vektah/gqlgen/neelance/query"
19 schema "github.com/vektah/gqlgen/neelance/schema"
20)
21
22// MakeExecutableSchema creates an ExecutableSchema from the Resolvers interface.
23func MakeExecutableSchema(resolvers Resolvers) graphql.ExecutableSchema {
24 return &executableSchema{resolvers: resolvers}
25}
26
27// NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
28func NewExecutableSchema(resolvers ResolverRoot) graphql.ExecutableSchema {
29 return MakeExecutableSchema(shortMapper{r: resolvers})
30}
31
32type Resolvers interface {
33 AddCommentOperation_date(ctx context.Context, obj *operations.AddCommentOperation) (time.Time, error)
34
35 Bug_status(ctx context.Context, obj *bug.Snapshot) (models.Status, error)
36
37 Bug_comments(ctx context.Context, obj *bug.Snapshot, after *string, before *string, first *int, last *int) (models.CommentConnection, error)
38 Bug_operations(ctx context.Context, obj *bug.Snapshot, after *string, before *string, first *int, last *int) (models.OperationConnection, error)
39
40 CreateOperation_date(ctx context.Context, obj *operations.CreateOperation) (time.Time, error)
41
42 LabelChangeOperation_date(ctx context.Context, obj *operations.LabelChangeOperation) (time.Time, error)
43
44 Mutation_newBug(ctx context.Context, repoRef *string, title string, message string, files []util.Hash) (bug.Snapshot, error)
45 Mutation_addComment(ctx context.Context, repoRef *string, prefix string, message string, files []util.Hash) (bug.Snapshot, error)
46 Mutation_changeLabels(ctx context.Context, repoRef *string, prefix string, added []string, removed []string) (bug.Snapshot, error)
47 Mutation_open(ctx context.Context, repoRef *string, prefix string) (bug.Snapshot, error)
48 Mutation_close(ctx context.Context, repoRef *string, prefix string) (bug.Snapshot, error)
49 Mutation_setTitle(ctx context.Context, repoRef *string, prefix string, title string) (bug.Snapshot, error)
50 Mutation_commit(ctx context.Context, repoRef *string, prefix string) (bug.Snapshot, error)
51
52 Query_defaultRepository(ctx context.Context) (*models.Repository, error)
53 Query_repository(ctx context.Context, id string) (*models.Repository, error)
54
55 Repository_allBugs(ctx context.Context, obj *models.Repository, after *string, before *string, first *int, last *int) (models.BugConnection, error)
56 Repository_bug(ctx context.Context, obj *models.Repository, prefix string) (*bug.Snapshot, error)
57
58 SetStatusOperation_date(ctx context.Context, obj *operations.SetStatusOperation) (time.Time, error)
59 SetStatusOperation_status(ctx context.Context, obj *operations.SetStatusOperation) (models.Status, error)
60
61 SetTitleOperation_date(ctx context.Context, obj *operations.SetTitleOperation) (time.Time, error)
62}
63
64type ResolverRoot interface {
65 AddCommentOperation() AddCommentOperationResolver
66 Bug() BugResolver
67 CreateOperation() CreateOperationResolver
68 LabelChangeOperation() LabelChangeOperationResolver
69 Mutation() MutationResolver
70 Query() QueryResolver
71 Repository() RepositoryResolver
72 SetStatusOperation() SetStatusOperationResolver
73 SetTitleOperation() SetTitleOperationResolver
74}
75type AddCommentOperationResolver interface {
76 Date(ctx context.Context, obj *operations.AddCommentOperation) (time.Time, error)
77}
78type BugResolver interface {
79 Status(ctx context.Context, obj *bug.Snapshot) (models.Status, error)
80
81 Comments(ctx context.Context, obj *bug.Snapshot, after *string, before *string, first *int, last *int) (models.CommentConnection, error)
82 Operations(ctx context.Context, obj *bug.Snapshot, after *string, before *string, first *int, last *int) (models.OperationConnection, error)
83}
84type CreateOperationResolver interface {
85 Date(ctx context.Context, obj *operations.CreateOperation) (time.Time, error)
86}
87type LabelChangeOperationResolver interface {
88 Date(ctx context.Context, obj *operations.LabelChangeOperation) (time.Time, error)
89}
90type MutationResolver interface {
91 NewBug(ctx context.Context, repoRef *string, title string, message string, files []util.Hash) (bug.Snapshot, error)
92 AddComment(ctx context.Context, repoRef *string, prefix string, message string, files []util.Hash) (bug.Snapshot, error)
93 ChangeLabels(ctx context.Context, repoRef *string, prefix string, added []string, removed []string) (bug.Snapshot, error)
94 Open(ctx context.Context, repoRef *string, prefix string) (bug.Snapshot, error)
95 Close(ctx context.Context, repoRef *string, prefix string) (bug.Snapshot, error)
96 SetTitle(ctx context.Context, repoRef *string, prefix string, title string) (bug.Snapshot, error)
97 Commit(ctx context.Context, repoRef *string, prefix string) (bug.Snapshot, error)
98}
99type QueryResolver interface {
100 DefaultRepository(ctx context.Context) (*models.Repository, error)
101 Repository(ctx context.Context, id string) (*models.Repository, error)
102}
103type RepositoryResolver interface {
104 AllBugs(ctx context.Context, obj *models.Repository, after *string, before *string, first *int, last *int) (models.BugConnection, error)
105 Bug(ctx context.Context, obj *models.Repository, prefix string) (*bug.Snapshot, error)
106}
107type SetStatusOperationResolver interface {
108 Date(ctx context.Context, obj *operations.SetStatusOperation) (time.Time, error)
109 Status(ctx context.Context, obj *operations.SetStatusOperation) (models.Status, error)
110}
111type SetTitleOperationResolver interface {
112 Date(ctx context.Context, obj *operations.SetTitleOperation) (time.Time, error)
113}
114
115type shortMapper struct {
116 r ResolverRoot
117}
118
119func (s shortMapper) AddCommentOperation_date(ctx context.Context, obj *operations.AddCommentOperation) (time.Time, error) {
120 return s.r.AddCommentOperation().Date(ctx, obj)
121}
122
123func (s shortMapper) Bug_status(ctx context.Context, obj *bug.Snapshot) (models.Status, error) {
124 return s.r.Bug().Status(ctx, obj)
125}
126
127func (s shortMapper) Bug_comments(ctx context.Context, obj *bug.Snapshot, after *string, before *string, first *int, last *int) (models.CommentConnection, error) {
128 return s.r.Bug().Comments(ctx, obj, after, before, first, last)
129}
130
131func (s shortMapper) Bug_operations(ctx context.Context, obj *bug.Snapshot, after *string, before *string, first *int, last *int) (models.OperationConnection, error) {
132 return s.r.Bug().Operations(ctx, obj, after, before, first, last)
133}
134
135func (s shortMapper) CreateOperation_date(ctx context.Context, obj *operations.CreateOperation) (time.Time, error) {
136 return s.r.CreateOperation().Date(ctx, obj)
137}
138
139func (s shortMapper) LabelChangeOperation_date(ctx context.Context, obj *operations.LabelChangeOperation) (time.Time, error) {
140 return s.r.LabelChangeOperation().Date(ctx, obj)
141}
142
143func (s shortMapper) Mutation_newBug(ctx context.Context, repoRef *string, title string, message string, files []util.Hash) (bug.Snapshot, error) {
144 return s.r.Mutation().NewBug(ctx, repoRef, title, message, files)
145}
146
147func (s shortMapper) Mutation_addComment(ctx context.Context, repoRef *string, prefix string, message string, files []util.Hash) (bug.Snapshot, error) {
148 return s.r.Mutation().AddComment(ctx, repoRef, prefix, message, files)
149}
150
151func (s shortMapper) Mutation_changeLabels(ctx context.Context, repoRef *string, prefix string, added []string, removed []string) (bug.Snapshot, error) {
152 return s.r.Mutation().ChangeLabels(ctx, repoRef, prefix, added, removed)
153}
154
155func (s shortMapper) Mutation_open(ctx context.Context, repoRef *string, prefix string) (bug.Snapshot, error) {
156 return s.r.Mutation().Open(ctx, repoRef, prefix)
157}
158
159func (s shortMapper) Mutation_close(ctx context.Context, repoRef *string, prefix string) (bug.Snapshot, error) {
160 return s.r.Mutation().Close(ctx, repoRef, prefix)
161}
162
163func (s shortMapper) Mutation_setTitle(ctx context.Context, repoRef *string, prefix string, title string) (bug.Snapshot, error) {
164 return s.r.Mutation().SetTitle(ctx, repoRef, prefix, title)
165}
166
167func (s shortMapper) Mutation_commit(ctx context.Context, repoRef *string, prefix string) (bug.Snapshot, error) {
168 return s.r.Mutation().Commit(ctx, repoRef, prefix)
169}
170
171func (s shortMapper) Query_defaultRepository(ctx context.Context) (*models.Repository, error) {
172 return s.r.Query().DefaultRepository(ctx)
173}
174
175func (s shortMapper) Query_repository(ctx context.Context, id string) (*models.Repository, error) {
176 return s.r.Query().Repository(ctx, id)
177}
178
179func (s shortMapper) Repository_allBugs(ctx context.Context, obj *models.Repository, after *string, before *string, first *int, last *int) (models.BugConnection, error) {
180 return s.r.Repository().AllBugs(ctx, obj, after, before, first, last)
181}
182
183func (s shortMapper) Repository_bug(ctx context.Context, obj *models.Repository, prefix string) (*bug.Snapshot, error) {
184 return s.r.Repository().Bug(ctx, obj, prefix)
185}
186
187func (s shortMapper) SetStatusOperation_date(ctx context.Context, obj *operations.SetStatusOperation) (time.Time, error) {
188 return s.r.SetStatusOperation().Date(ctx, obj)
189}
190
191func (s shortMapper) SetStatusOperation_status(ctx context.Context, obj *operations.SetStatusOperation) (models.Status, error) {
192 return s.r.SetStatusOperation().Status(ctx, obj)
193}
194
195func (s shortMapper) SetTitleOperation_date(ctx context.Context, obj *operations.SetTitleOperation) (time.Time, error) {
196 return s.r.SetTitleOperation().Date(ctx, obj)
197}
198
199type executableSchema struct {
200 resolvers Resolvers
201}
202
203func (e *executableSchema) Schema() *schema.Schema {
204 return parsedSchema
205}
206
207func (e *executableSchema) Query(ctx context.Context, op *query.Operation) *graphql.Response {
208 ec := executionContext{graphql.GetRequestContext(ctx), e.resolvers}
209
210 buf := ec.RequestMiddleware(ctx, func(ctx context.Context) []byte {
211 data := ec._Query(ctx, op.Selections)
212 var buf bytes.Buffer
213 data.MarshalGQL(&buf)
214 return buf.Bytes()
215 })
216
217 return &graphql.Response{
218 Data: buf,
219 Errors: ec.Errors,
220 }
221}
222
223func (e *executableSchema) Mutation(ctx context.Context, op *query.Operation) *graphql.Response {
224 ec := executionContext{graphql.GetRequestContext(ctx), e.resolvers}
225
226 buf := ec.RequestMiddleware(ctx, func(ctx context.Context) []byte {
227 data := ec._Mutation(ctx, op.Selections)
228 var buf bytes.Buffer
229 data.MarshalGQL(&buf)
230 return buf.Bytes()
231 })
232
233 return &graphql.Response{
234 Data: buf,
235 Errors: ec.Errors,
236 }
237}
238
239func (e *executableSchema) Subscription(ctx context.Context, op *query.Operation) func() *graphql.Response {
240 return graphql.OneShot(graphql.ErrorResponse(ctx, "subscriptions are not supported"))
241}
242
243type executionContext struct {
244 *graphql.RequestContext
245
246 resolvers Resolvers
247}
248
249var addCommentOperationImplementors = []string{"AddCommentOperation", "Operation", "Authored"}
250
251// nolint: gocyclo, errcheck, gas, goconst
252func (ec *executionContext) _AddCommentOperation(ctx context.Context, sel []query.Selection, obj *operations.AddCommentOperation) graphql.Marshaler {
253 fields := graphql.CollectFields(ec.Doc, sel, addCommentOperationImplementors, ec.Variables)
254
255 out := graphql.NewOrderedMap(len(fields))
256 for i, field := range fields {
257 out.Keys[i] = field.Alias
258
259 switch field.Name {
260 case "__typename":
261 out.Values[i] = graphql.MarshalString("AddCommentOperation")
262 case "author":
263 out.Values[i] = ec._AddCommentOperation_author(ctx, field, obj)
264 case "date":
265 out.Values[i] = ec._AddCommentOperation_date(ctx, field, obj)
266 case "message":
267 out.Values[i] = ec._AddCommentOperation_message(ctx, field, obj)
268 case "files":
269 out.Values[i] = ec._AddCommentOperation_files(ctx, field, obj)
270 default:
271 panic("unknown field " + strconv.Quote(field.Name))
272 }
273 }
274
275 return out
276}
277
278func (ec *executionContext) _AddCommentOperation_author(ctx context.Context, field graphql.CollectedField, obj *operations.AddCommentOperation) graphql.Marshaler {
279 rctx := graphql.GetResolverContext(ctx)
280 rctx.Object = "AddCommentOperation"
281 rctx.Args = nil
282 rctx.Field = field
283 rctx.PushField(field.Alias)
284 defer rctx.Pop()
285 res := obj.Author
286 return ec._Person(ctx, field.Selections, &res)
287}
288
289func (ec *executionContext) _AddCommentOperation_date(ctx context.Context, field graphql.CollectedField, obj *operations.AddCommentOperation) graphql.Marshaler {
290 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{
291 Object: "AddCommentOperation",
292 Args: nil,
293 Field: field,
294 })
295 return graphql.Defer(func() (ret graphql.Marshaler) {
296 defer func() {
297 if r := recover(); r != nil {
298 userErr := ec.Recover(ctx, r)
299 ec.Error(ctx, userErr)
300 ret = graphql.Null
301 }
302 }()
303
304 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
305 return ec.resolvers.AddCommentOperation_date(ctx, obj)
306 })
307 if err != nil {
308 ec.Error(ctx, err)
309 return graphql.Null
310 }
311 if resTmp == nil {
312 return graphql.Null
313 }
314 res := resTmp.(time.Time)
315 return graphql.MarshalTime(res)
316 })
317}
318
319func (ec *executionContext) _AddCommentOperation_message(ctx context.Context, field graphql.CollectedField, obj *operations.AddCommentOperation) graphql.Marshaler {
320 rctx := graphql.GetResolverContext(ctx)
321 rctx.Object = "AddCommentOperation"
322 rctx.Args = nil
323 rctx.Field = field
324 rctx.PushField(field.Alias)
325 defer rctx.Pop()
326 res := obj.Message
327 return graphql.MarshalString(res)
328}
329
330func (ec *executionContext) _AddCommentOperation_files(ctx context.Context, field graphql.CollectedField, obj *operations.AddCommentOperation) graphql.Marshaler {
331 rctx := graphql.GetResolverContext(ctx)
332 rctx.Object = "AddCommentOperation"
333 rctx.Args = nil
334 rctx.Field = field
335 rctx.PushField(field.Alias)
336 defer rctx.Pop()
337 res := obj.Files()
338 arr1 := graphql.Array{}
339 for idx1 := range res {
340 arr1 = append(arr1, func() graphql.Marshaler {
341 rctx := graphql.GetResolverContext(ctx)
342 rctx.PushIndex(idx1)
343 defer rctx.Pop()
344 return res[idx1]
345 }())
346 }
347 return arr1
348}
349
350var bugImplementors = []string{"Bug"}
351
352// nolint: gocyclo, errcheck, gas, goconst
353func (ec *executionContext) _Bug(ctx context.Context, sel []query.Selection, obj *bug.Snapshot) graphql.Marshaler {
354 fields := graphql.CollectFields(ec.Doc, sel, bugImplementors, ec.Variables)
355
356 out := graphql.NewOrderedMap(len(fields))
357 for i, field := range fields {
358 out.Keys[i] = field.Alias
359
360 switch field.Name {
361 case "__typename":
362 out.Values[i] = graphql.MarshalString("Bug")
363 case "id":
364 out.Values[i] = ec._Bug_id(ctx, field, obj)
365 case "humanId":
366 out.Values[i] = ec._Bug_humanId(ctx, field, obj)
367 case "status":
368 out.Values[i] = ec._Bug_status(ctx, field, obj)
369 case "title":
370 out.Values[i] = ec._Bug_title(ctx, field, obj)
371 case "labels":
372 out.Values[i] = ec._Bug_labels(ctx, field, obj)
373 case "author":
374 out.Values[i] = ec._Bug_author(ctx, field, obj)
375 case "createdAt":
376 out.Values[i] = ec._Bug_createdAt(ctx, field, obj)
377 case "lastEdit":
378 out.Values[i] = ec._Bug_lastEdit(ctx, field, obj)
379 case "comments":
380 out.Values[i] = ec._Bug_comments(ctx, field, obj)
381 case "operations":
382 out.Values[i] = ec._Bug_operations(ctx, field, obj)
383 default:
384 panic("unknown field " + strconv.Quote(field.Name))
385 }
386 }
387
388 return out
389}
390
391func (ec *executionContext) _Bug_id(ctx context.Context, field graphql.CollectedField, obj *bug.Snapshot) graphql.Marshaler {
392 rctx := graphql.GetResolverContext(ctx)
393 rctx.Object = "Bug"
394 rctx.Args = nil
395 rctx.Field = field
396 rctx.PushField(field.Alias)
397 defer rctx.Pop()
398 res := obj.Id()
399 return graphql.MarshalString(res)
400}
401
402func (ec *executionContext) _Bug_humanId(ctx context.Context, field graphql.CollectedField, obj *bug.Snapshot) graphql.Marshaler {
403 rctx := graphql.GetResolverContext(ctx)
404 rctx.Object = "Bug"
405 rctx.Args = nil
406 rctx.Field = field
407 rctx.PushField(field.Alias)
408 defer rctx.Pop()
409 res := obj.HumanId()
410 return graphql.MarshalString(res)
411}
412
413func (ec *executionContext) _Bug_status(ctx context.Context, field graphql.CollectedField, obj *bug.Snapshot) graphql.Marshaler {
414 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{
415 Object: "Bug",
416 Args: nil,
417 Field: field,
418 })
419 return graphql.Defer(func() (ret graphql.Marshaler) {
420 defer func() {
421 if r := recover(); r != nil {
422 userErr := ec.Recover(ctx, r)
423 ec.Error(ctx, userErr)
424 ret = graphql.Null
425 }
426 }()
427
428 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
429 return ec.resolvers.Bug_status(ctx, obj)
430 })
431 if err != nil {
432 ec.Error(ctx, err)
433 return graphql.Null
434 }
435 if resTmp == nil {
436 return graphql.Null
437 }
438 res := resTmp.(models.Status)
439 return res
440 })
441}
442
443func (ec *executionContext) _Bug_title(ctx context.Context, field graphql.CollectedField, obj *bug.Snapshot) graphql.Marshaler {
444 rctx := graphql.GetResolverContext(ctx)
445 rctx.Object = "Bug"
446 rctx.Args = nil
447 rctx.Field = field
448 rctx.PushField(field.Alias)
449 defer rctx.Pop()
450 res := obj.Title
451 return graphql.MarshalString(res)
452}
453
454func (ec *executionContext) _Bug_labels(ctx context.Context, field graphql.CollectedField, obj *bug.Snapshot) graphql.Marshaler {
455 rctx := graphql.GetResolverContext(ctx)
456 rctx.Object = "Bug"
457 rctx.Args = nil
458 rctx.Field = field
459 rctx.PushField(field.Alias)
460 defer rctx.Pop()
461 res := obj.Labels
462 arr1 := graphql.Array{}
463 for idx1 := range res {
464 arr1 = append(arr1, func() graphql.Marshaler {
465 rctx := graphql.GetResolverContext(ctx)
466 rctx.PushIndex(idx1)
467 defer rctx.Pop()
468 return res[idx1]
469 }())
470 }
471 return arr1
472}
473
474func (ec *executionContext) _Bug_author(ctx context.Context, field graphql.CollectedField, obj *bug.Snapshot) graphql.Marshaler {
475 rctx := graphql.GetResolverContext(ctx)
476 rctx.Object = "Bug"
477 rctx.Args = nil
478 rctx.Field = field
479 rctx.PushField(field.Alias)
480 defer rctx.Pop()
481 res := obj.Author
482 return ec._Person(ctx, field.Selections, &res)
483}
484
485func (ec *executionContext) _Bug_createdAt(ctx context.Context, field graphql.CollectedField, obj *bug.Snapshot) graphql.Marshaler {
486 rctx := graphql.GetResolverContext(ctx)
487 rctx.Object = "Bug"
488 rctx.Args = nil
489 rctx.Field = field
490 rctx.PushField(field.Alias)
491 defer rctx.Pop()
492 res := obj.CreatedAt
493 return graphql.MarshalTime(res)
494}
495
496func (ec *executionContext) _Bug_lastEdit(ctx context.Context, field graphql.CollectedField, obj *bug.Snapshot) graphql.Marshaler {
497 rctx := graphql.GetResolverContext(ctx)
498 rctx.Object = "Bug"
499 rctx.Args = nil
500 rctx.Field = field
501 rctx.PushField(field.Alias)
502 defer rctx.Pop()
503 res := obj.LastEdit()
504 return graphql.MarshalTime(res)
505}
506
507func (ec *executionContext) _Bug_comments(ctx context.Context, field graphql.CollectedField, obj *bug.Snapshot) graphql.Marshaler {
508 args := map[string]interface{}{}
509 var arg0 *string
510 if tmp, ok := field.Args["after"]; ok {
511 var err error
512 var ptr1 string
513 if tmp != nil {
514 ptr1, err = graphql.UnmarshalString(tmp)
515 arg0 = &ptr1
516 }
517
518 if err != nil {
519 ec.Error(ctx, err)
520 return graphql.Null
521 }
522 }
523 args["after"] = arg0
524 var arg1 *string
525 if tmp, ok := field.Args["before"]; ok {
526 var err error
527 var ptr1 string
528 if tmp != nil {
529 ptr1, err = graphql.UnmarshalString(tmp)
530 arg1 = &ptr1
531 }
532
533 if err != nil {
534 ec.Error(ctx, err)
535 return graphql.Null
536 }
537 }
538 args["before"] = arg1
539 var arg2 *int
540 if tmp, ok := field.Args["first"]; ok {
541 var err error
542 var ptr1 int
543 if tmp != nil {
544 ptr1, err = graphql.UnmarshalInt(tmp)
545 arg2 = &ptr1
546 }
547
548 if err != nil {
549 ec.Error(ctx, err)
550 return graphql.Null
551 }
552 }
553 args["first"] = arg2
554 var arg3 *int
555 if tmp, ok := field.Args["last"]; ok {
556 var err error
557 var ptr1 int
558 if tmp != nil {
559 ptr1, err = graphql.UnmarshalInt(tmp)
560 arg3 = &ptr1
561 }
562
563 if err != nil {
564 ec.Error(ctx, err)
565 return graphql.Null
566 }
567 }
568 args["last"] = arg3
569 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{
570 Object: "Bug",
571 Args: args,
572 Field: field,
573 })
574 return graphql.Defer(func() (ret graphql.Marshaler) {
575 defer func() {
576 if r := recover(); r != nil {
577 userErr := ec.Recover(ctx, r)
578 ec.Error(ctx, userErr)
579 ret = graphql.Null
580 }
581 }()
582
583 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
584 return ec.resolvers.Bug_comments(ctx, obj, args["after"].(*string), args["before"].(*string), args["first"].(*int), args["last"].(*int))
585 })
586 if err != nil {
587 ec.Error(ctx, err)
588 return graphql.Null
589 }
590 if resTmp == nil {
591 return graphql.Null
592 }
593 res := resTmp.(models.CommentConnection)
594 return ec._CommentConnection(ctx, field.Selections, &res)
595 })
596}
597
598func (ec *executionContext) _Bug_operations(ctx context.Context, field graphql.CollectedField, obj *bug.Snapshot) graphql.Marshaler {
599 args := map[string]interface{}{}
600 var arg0 *string
601 if tmp, ok := field.Args["after"]; ok {
602 var err error
603 var ptr1 string
604 if tmp != nil {
605 ptr1, err = graphql.UnmarshalString(tmp)
606 arg0 = &ptr1
607 }
608
609 if err != nil {
610 ec.Error(ctx, err)
611 return graphql.Null
612 }
613 }
614 args["after"] = arg0
615 var arg1 *string
616 if tmp, ok := field.Args["before"]; ok {
617 var err error
618 var ptr1 string
619 if tmp != nil {
620 ptr1, err = graphql.UnmarshalString(tmp)
621 arg1 = &ptr1
622 }
623
624 if err != nil {
625 ec.Error(ctx, err)
626 return graphql.Null
627 }
628 }
629 args["before"] = arg1
630 var arg2 *int
631 if tmp, ok := field.Args["first"]; ok {
632 var err error
633 var ptr1 int
634 if tmp != nil {
635 ptr1, err = graphql.UnmarshalInt(tmp)
636 arg2 = &ptr1
637 }
638
639 if err != nil {
640 ec.Error(ctx, err)
641 return graphql.Null
642 }
643 }
644 args["first"] = arg2
645 var arg3 *int
646 if tmp, ok := field.Args["last"]; ok {
647 var err error
648 var ptr1 int
649 if tmp != nil {
650 ptr1, err = graphql.UnmarshalInt(tmp)
651 arg3 = &ptr1
652 }
653
654 if err != nil {
655 ec.Error(ctx, err)
656 return graphql.Null
657 }
658 }
659 args["last"] = arg3
660 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{
661 Object: "Bug",
662 Args: args,
663 Field: field,
664 })
665 return graphql.Defer(func() (ret graphql.Marshaler) {
666 defer func() {
667 if r := recover(); r != nil {
668 userErr := ec.Recover(ctx, r)
669 ec.Error(ctx, userErr)
670 ret = graphql.Null
671 }
672 }()
673
674 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
675 return ec.resolvers.Bug_operations(ctx, obj, args["after"].(*string), args["before"].(*string), args["first"].(*int), args["last"].(*int))
676 })
677 if err != nil {
678 ec.Error(ctx, err)
679 return graphql.Null
680 }
681 if resTmp == nil {
682 return graphql.Null
683 }
684 res := resTmp.(models.OperationConnection)
685 return ec._OperationConnection(ctx, field.Selections, &res)
686 })
687}
688
689var bugConnectionImplementors = []string{"BugConnection"}
690
691// nolint: gocyclo, errcheck, gas, goconst
692func (ec *executionContext) _BugConnection(ctx context.Context, sel []query.Selection, obj *models.BugConnection) graphql.Marshaler {
693 fields := graphql.CollectFields(ec.Doc, sel, bugConnectionImplementors, ec.Variables)
694
695 out := graphql.NewOrderedMap(len(fields))
696 for i, field := range fields {
697 out.Keys[i] = field.Alias
698
699 switch field.Name {
700 case "__typename":
701 out.Values[i] = graphql.MarshalString("BugConnection")
702 case "edges":
703 out.Values[i] = ec._BugConnection_edges(ctx, field, obj)
704 case "nodes":
705 out.Values[i] = ec._BugConnection_nodes(ctx, field, obj)
706 case "pageInfo":
707 out.Values[i] = ec._BugConnection_pageInfo(ctx, field, obj)
708 case "totalCount":
709 out.Values[i] = ec._BugConnection_totalCount(ctx, field, obj)
710 default:
711 panic("unknown field " + strconv.Quote(field.Name))
712 }
713 }
714
715 return out
716}
717
718func (ec *executionContext) _BugConnection_edges(ctx context.Context, field graphql.CollectedField, obj *models.BugConnection) graphql.Marshaler {
719 rctx := graphql.GetResolverContext(ctx)
720 rctx.Object = "BugConnection"
721 rctx.Args = nil
722 rctx.Field = field
723 rctx.PushField(field.Alias)
724 defer rctx.Pop()
725 res := obj.Edges
726 arr1 := graphql.Array{}
727 for idx1 := range res {
728 arr1 = append(arr1, func() graphql.Marshaler {
729 rctx := graphql.GetResolverContext(ctx)
730 rctx.PushIndex(idx1)
731 defer rctx.Pop()
732 return ec._BugEdge(ctx, field.Selections, &res[idx1])
733 }())
734 }
735 return arr1
736}
737
738func (ec *executionContext) _BugConnection_nodes(ctx context.Context, field graphql.CollectedField, obj *models.BugConnection) graphql.Marshaler {
739 rctx := graphql.GetResolverContext(ctx)
740 rctx.Object = "BugConnection"
741 rctx.Args = nil
742 rctx.Field = field
743 rctx.PushField(field.Alias)
744 defer rctx.Pop()
745 res := obj.Nodes
746 arr1 := graphql.Array{}
747 for idx1 := range res {
748 arr1 = append(arr1, func() graphql.Marshaler {
749 rctx := graphql.GetResolverContext(ctx)
750 rctx.PushIndex(idx1)
751 defer rctx.Pop()
752 return ec._Bug(ctx, field.Selections, &res[idx1])
753 }())
754 }
755 return arr1
756}
757
758func (ec *executionContext) _BugConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *models.BugConnection) graphql.Marshaler {
759 rctx := graphql.GetResolverContext(ctx)
760 rctx.Object = "BugConnection"
761 rctx.Args = nil
762 rctx.Field = field
763 rctx.PushField(field.Alias)
764 defer rctx.Pop()
765 res := obj.PageInfo
766 return ec._PageInfo(ctx, field.Selections, &res)
767}
768
769func (ec *executionContext) _BugConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *models.BugConnection) graphql.Marshaler {
770 rctx := graphql.GetResolverContext(ctx)
771 rctx.Object = "BugConnection"
772 rctx.Args = nil
773 rctx.Field = field
774 rctx.PushField(field.Alias)
775 defer rctx.Pop()
776 res := obj.TotalCount
777 return graphql.MarshalInt(res)
778}
779
780var bugEdgeImplementors = []string{"BugEdge"}
781
782// nolint: gocyclo, errcheck, gas, goconst
783func (ec *executionContext) _BugEdge(ctx context.Context, sel []query.Selection, obj *models.BugEdge) graphql.Marshaler {
784 fields := graphql.CollectFields(ec.Doc, sel, bugEdgeImplementors, ec.Variables)
785
786 out := graphql.NewOrderedMap(len(fields))
787 for i, field := range fields {
788 out.Keys[i] = field.Alias
789
790 switch field.Name {
791 case "__typename":
792 out.Values[i] = graphql.MarshalString("BugEdge")
793 case "cursor":
794 out.Values[i] = ec._BugEdge_cursor(ctx, field, obj)
795 case "node":
796 out.Values[i] = ec._BugEdge_node(ctx, field, obj)
797 default:
798 panic("unknown field " + strconv.Quote(field.Name))
799 }
800 }
801
802 return out
803}
804
805func (ec *executionContext) _BugEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *models.BugEdge) graphql.Marshaler {
806 rctx := graphql.GetResolverContext(ctx)
807 rctx.Object = "BugEdge"
808 rctx.Args = nil
809 rctx.Field = field
810 rctx.PushField(field.Alias)
811 defer rctx.Pop()
812 res := obj.Cursor
813 return graphql.MarshalString(res)
814}
815
816func (ec *executionContext) _BugEdge_node(ctx context.Context, field graphql.CollectedField, obj *models.BugEdge) graphql.Marshaler {
817 rctx := graphql.GetResolverContext(ctx)
818 rctx.Object = "BugEdge"
819 rctx.Args = nil
820 rctx.Field = field
821 rctx.PushField(field.Alias)
822 defer rctx.Pop()
823 res := obj.Node
824 return ec._Bug(ctx, field.Selections, &res)
825}
826
827var commentImplementors = []string{"Comment", "Authored"}
828
829// nolint: gocyclo, errcheck, gas, goconst
830func (ec *executionContext) _Comment(ctx context.Context, sel []query.Selection, obj *bug.Comment) graphql.Marshaler {
831 fields := graphql.CollectFields(ec.Doc, sel, commentImplementors, ec.Variables)
832
833 out := graphql.NewOrderedMap(len(fields))
834 for i, field := range fields {
835 out.Keys[i] = field.Alias
836
837 switch field.Name {
838 case "__typename":
839 out.Values[i] = graphql.MarshalString("Comment")
840 case "author":
841 out.Values[i] = ec._Comment_author(ctx, field, obj)
842 case "message":
843 out.Values[i] = ec._Comment_message(ctx, field, obj)
844 case "files":
845 out.Values[i] = ec._Comment_files(ctx, field, obj)
846 default:
847 panic("unknown field " + strconv.Quote(field.Name))
848 }
849 }
850
851 return out
852}
853
854func (ec *executionContext) _Comment_author(ctx context.Context, field graphql.CollectedField, obj *bug.Comment) graphql.Marshaler {
855 rctx := graphql.GetResolverContext(ctx)
856 rctx.Object = "Comment"
857 rctx.Args = nil
858 rctx.Field = field
859 rctx.PushField(field.Alias)
860 defer rctx.Pop()
861 res := obj.Author
862 return ec._Person(ctx, field.Selections, &res)
863}
864
865func (ec *executionContext) _Comment_message(ctx context.Context, field graphql.CollectedField, obj *bug.Comment) graphql.Marshaler {
866 rctx := graphql.GetResolverContext(ctx)
867 rctx.Object = "Comment"
868 rctx.Args = nil
869 rctx.Field = field
870 rctx.PushField(field.Alias)
871 defer rctx.Pop()
872 res := obj.Message
873 return graphql.MarshalString(res)
874}
875
876func (ec *executionContext) _Comment_files(ctx context.Context, field graphql.CollectedField, obj *bug.Comment) graphql.Marshaler {
877 rctx := graphql.GetResolverContext(ctx)
878 rctx.Object = "Comment"
879 rctx.Args = nil
880 rctx.Field = field
881 rctx.PushField(field.Alias)
882 defer rctx.Pop()
883 res := obj.Files
884 arr1 := graphql.Array{}
885 for idx1 := range res {
886 arr1 = append(arr1, func() graphql.Marshaler {
887 rctx := graphql.GetResolverContext(ctx)
888 rctx.PushIndex(idx1)
889 defer rctx.Pop()
890 return res[idx1]
891 }())
892 }
893 return arr1
894}
895
896var commentConnectionImplementors = []string{"CommentConnection"}
897
898// nolint: gocyclo, errcheck, gas, goconst
899func (ec *executionContext) _CommentConnection(ctx context.Context, sel []query.Selection, obj *models.CommentConnection) graphql.Marshaler {
900 fields := graphql.CollectFields(ec.Doc, sel, commentConnectionImplementors, ec.Variables)
901
902 out := graphql.NewOrderedMap(len(fields))
903 for i, field := range fields {
904 out.Keys[i] = field.Alias
905
906 switch field.Name {
907 case "__typename":
908 out.Values[i] = graphql.MarshalString("CommentConnection")
909 case "edges":
910 out.Values[i] = ec._CommentConnection_edges(ctx, field, obj)
911 case "nodes":
912 out.Values[i] = ec._CommentConnection_nodes(ctx, field, obj)
913 case "pageInfo":
914 out.Values[i] = ec._CommentConnection_pageInfo(ctx, field, obj)
915 case "totalCount":
916 out.Values[i] = ec._CommentConnection_totalCount(ctx, field, obj)
917 default:
918 panic("unknown field " + strconv.Quote(field.Name))
919 }
920 }
921
922 return out
923}
924
925func (ec *executionContext) _CommentConnection_edges(ctx context.Context, field graphql.CollectedField, obj *models.CommentConnection) graphql.Marshaler {
926 rctx := graphql.GetResolverContext(ctx)
927 rctx.Object = "CommentConnection"
928 rctx.Args = nil
929 rctx.Field = field
930 rctx.PushField(field.Alias)
931 defer rctx.Pop()
932 res := obj.Edges
933 arr1 := graphql.Array{}
934 for idx1 := range res {
935 arr1 = append(arr1, func() graphql.Marshaler {
936 rctx := graphql.GetResolverContext(ctx)
937 rctx.PushIndex(idx1)
938 defer rctx.Pop()
939 return ec._CommentEdge(ctx, field.Selections, &res[idx1])
940 }())
941 }
942 return arr1
943}
944
945func (ec *executionContext) _CommentConnection_nodes(ctx context.Context, field graphql.CollectedField, obj *models.CommentConnection) graphql.Marshaler {
946 rctx := graphql.GetResolverContext(ctx)
947 rctx.Object = "CommentConnection"
948 rctx.Args = nil
949 rctx.Field = field
950 rctx.PushField(field.Alias)
951 defer rctx.Pop()
952 res := obj.Nodes
953 arr1 := graphql.Array{}
954 for idx1 := range res {
955 arr1 = append(arr1, func() graphql.Marshaler {
956 rctx := graphql.GetResolverContext(ctx)
957 rctx.PushIndex(idx1)
958 defer rctx.Pop()
959 return ec._Comment(ctx, field.Selections, &res[idx1])
960 }())
961 }
962 return arr1
963}
964
965func (ec *executionContext) _CommentConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *models.CommentConnection) graphql.Marshaler {
966 rctx := graphql.GetResolverContext(ctx)
967 rctx.Object = "CommentConnection"
968 rctx.Args = nil
969 rctx.Field = field
970 rctx.PushField(field.Alias)
971 defer rctx.Pop()
972 res := obj.PageInfo
973 return ec._PageInfo(ctx, field.Selections, &res)
974}
975
976func (ec *executionContext) _CommentConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *models.CommentConnection) graphql.Marshaler {
977 rctx := graphql.GetResolverContext(ctx)
978 rctx.Object = "CommentConnection"
979 rctx.Args = nil
980 rctx.Field = field
981 rctx.PushField(field.Alias)
982 defer rctx.Pop()
983 res := obj.TotalCount
984 return graphql.MarshalInt(res)
985}
986
987var commentEdgeImplementors = []string{"CommentEdge"}
988
989// nolint: gocyclo, errcheck, gas, goconst
990func (ec *executionContext) _CommentEdge(ctx context.Context, sel []query.Selection, obj *models.CommentEdge) graphql.Marshaler {
991 fields := graphql.CollectFields(ec.Doc, sel, commentEdgeImplementors, ec.Variables)
992
993 out := graphql.NewOrderedMap(len(fields))
994 for i, field := range fields {
995 out.Keys[i] = field.Alias
996
997 switch field.Name {
998 case "__typename":
999 out.Values[i] = graphql.MarshalString("CommentEdge")
1000 case "cursor":
1001 out.Values[i] = ec._CommentEdge_cursor(ctx, field, obj)
1002 case "node":
1003 out.Values[i] = ec._CommentEdge_node(ctx, field, obj)
1004 default:
1005 panic("unknown field " + strconv.Quote(field.Name))
1006 }
1007 }
1008
1009 return out
1010}
1011
1012func (ec *executionContext) _CommentEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *models.CommentEdge) graphql.Marshaler {
1013 rctx := graphql.GetResolverContext(ctx)
1014 rctx.Object = "CommentEdge"
1015 rctx.Args = nil
1016 rctx.Field = field
1017 rctx.PushField(field.Alias)
1018 defer rctx.Pop()
1019 res := obj.Cursor
1020 return graphql.MarshalString(res)
1021}
1022
1023func (ec *executionContext) _CommentEdge_node(ctx context.Context, field graphql.CollectedField, obj *models.CommentEdge) graphql.Marshaler {
1024 rctx := graphql.GetResolverContext(ctx)
1025 rctx.Object = "CommentEdge"
1026 rctx.Args = nil
1027 rctx.Field = field
1028 rctx.PushField(field.Alias)
1029 defer rctx.Pop()
1030 res := obj.Node
1031 return ec._Comment(ctx, field.Selections, &res)
1032}
1033
1034var createOperationImplementors = []string{"CreateOperation", "Operation", "Authored"}
1035
1036// nolint: gocyclo, errcheck, gas, goconst
1037func (ec *executionContext) _CreateOperation(ctx context.Context, sel []query.Selection, obj *operations.CreateOperation) graphql.Marshaler {
1038 fields := graphql.CollectFields(ec.Doc, sel, createOperationImplementors, ec.Variables)
1039
1040 out := graphql.NewOrderedMap(len(fields))
1041 for i, field := range fields {
1042 out.Keys[i] = field.Alias
1043
1044 switch field.Name {
1045 case "__typename":
1046 out.Values[i] = graphql.MarshalString("CreateOperation")
1047 case "author":
1048 out.Values[i] = ec._CreateOperation_author(ctx, field, obj)
1049 case "date":
1050 out.Values[i] = ec._CreateOperation_date(ctx, field, obj)
1051 case "title":
1052 out.Values[i] = ec._CreateOperation_title(ctx, field, obj)
1053 case "message":
1054 out.Values[i] = ec._CreateOperation_message(ctx, field, obj)
1055 case "files":
1056 out.Values[i] = ec._CreateOperation_files(ctx, field, obj)
1057 default:
1058 panic("unknown field " + strconv.Quote(field.Name))
1059 }
1060 }
1061
1062 return out
1063}
1064
1065func (ec *executionContext) _CreateOperation_author(ctx context.Context, field graphql.CollectedField, obj *operations.CreateOperation) graphql.Marshaler {
1066 rctx := graphql.GetResolverContext(ctx)
1067 rctx.Object = "CreateOperation"
1068 rctx.Args = nil
1069 rctx.Field = field
1070 rctx.PushField(field.Alias)
1071 defer rctx.Pop()
1072 res := obj.Author
1073 return ec._Person(ctx, field.Selections, &res)
1074}
1075
1076func (ec *executionContext) _CreateOperation_date(ctx context.Context, field graphql.CollectedField, obj *operations.CreateOperation) graphql.Marshaler {
1077 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{
1078 Object: "CreateOperation",
1079 Args: nil,
1080 Field: field,
1081 })
1082 return graphql.Defer(func() (ret graphql.Marshaler) {
1083 defer func() {
1084 if r := recover(); r != nil {
1085 userErr := ec.Recover(ctx, r)
1086 ec.Error(ctx, userErr)
1087 ret = graphql.Null
1088 }
1089 }()
1090
1091 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
1092 return ec.resolvers.CreateOperation_date(ctx, obj)
1093 })
1094 if err != nil {
1095 ec.Error(ctx, err)
1096 return graphql.Null
1097 }
1098 if resTmp == nil {
1099 return graphql.Null
1100 }
1101 res := resTmp.(time.Time)
1102 return graphql.MarshalTime(res)
1103 })
1104}
1105
1106func (ec *executionContext) _CreateOperation_title(ctx context.Context, field graphql.CollectedField, obj *operations.CreateOperation) graphql.Marshaler {
1107 rctx := graphql.GetResolverContext(ctx)
1108 rctx.Object = "CreateOperation"
1109 rctx.Args = nil
1110 rctx.Field = field
1111 rctx.PushField(field.Alias)
1112 defer rctx.Pop()
1113 res := obj.Title
1114 return graphql.MarshalString(res)
1115}
1116
1117func (ec *executionContext) _CreateOperation_message(ctx context.Context, field graphql.CollectedField, obj *operations.CreateOperation) graphql.Marshaler {
1118 rctx := graphql.GetResolverContext(ctx)
1119 rctx.Object = "CreateOperation"
1120 rctx.Args = nil
1121 rctx.Field = field
1122 rctx.PushField(field.Alias)
1123 defer rctx.Pop()
1124 res := obj.Message
1125 return graphql.MarshalString(res)
1126}
1127
1128func (ec *executionContext) _CreateOperation_files(ctx context.Context, field graphql.CollectedField, obj *operations.CreateOperation) graphql.Marshaler {
1129 rctx := graphql.GetResolverContext(ctx)
1130 rctx.Object = "CreateOperation"
1131 rctx.Args = nil
1132 rctx.Field = field
1133 rctx.PushField(field.Alias)
1134 defer rctx.Pop()
1135 res := obj.Files()
1136 arr1 := graphql.Array{}
1137 for idx1 := range res {
1138 arr1 = append(arr1, func() graphql.Marshaler {
1139 rctx := graphql.GetResolverContext(ctx)
1140 rctx.PushIndex(idx1)
1141 defer rctx.Pop()
1142 return res[idx1]
1143 }())
1144 }
1145 return arr1
1146}
1147
1148var labelChangeOperationImplementors = []string{"LabelChangeOperation", "Operation", "Authored"}
1149
1150// nolint: gocyclo, errcheck, gas, goconst
1151func (ec *executionContext) _LabelChangeOperation(ctx context.Context, sel []query.Selection, obj *operations.LabelChangeOperation) graphql.Marshaler {
1152 fields := graphql.CollectFields(ec.Doc, sel, labelChangeOperationImplementors, ec.Variables)
1153
1154 out := graphql.NewOrderedMap(len(fields))
1155 for i, field := range fields {
1156 out.Keys[i] = field.Alias
1157
1158 switch field.Name {
1159 case "__typename":
1160 out.Values[i] = graphql.MarshalString("LabelChangeOperation")
1161 case "author":
1162 out.Values[i] = ec._LabelChangeOperation_author(ctx, field, obj)
1163 case "date":
1164 out.Values[i] = ec._LabelChangeOperation_date(ctx, field, obj)
1165 case "added":
1166 out.Values[i] = ec._LabelChangeOperation_added(ctx, field, obj)
1167 case "removed":
1168 out.Values[i] = ec._LabelChangeOperation_removed(ctx, field, obj)
1169 default:
1170 panic("unknown field " + strconv.Quote(field.Name))
1171 }
1172 }
1173
1174 return out
1175}
1176
1177func (ec *executionContext) _LabelChangeOperation_author(ctx context.Context, field graphql.CollectedField, obj *operations.LabelChangeOperation) graphql.Marshaler {
1178 rctx := graphql.GetResolverContext(ctx)
1179 rctx.Object = "LabelChangeOperation"
1180 rctx.Args = nil
1181 rctx.Field = field
1182 rctx.PushField(field.Alias)
1183 defer rctx.Pop()
1184 res := obj.Author
1185 return ec._Person(ctx, field.Selections, &res)
1186}
1187
1188func (ec *executionContext) _LabelChangeOperation_date(ctx context.Context, field graphql.CollectedField, obj *operations.LabelChangeOperation) graphql.Marshaler {
1189 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{
1190 Object: "LabelChangeOperation",
1191 Args: nil,
1192 Field: field,
1193 })
1194 return graphql.Defer(func() (ret graphql.Marshaler) {
1195 defer func() {
1196 if r := recover(); r != nil {
1197 userErr := ec.Recover(ctx, r)
1198 ec.Error(ctx, userErr)
1199 ret = graphql.Null
1200 }
1201 }()
1202
1203 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
1204 return ec.resolvers.LabelChangeOperation_date(ctx, obj)
1205 })
1206 if err != nil {
1207 ec.Error(ctx, err)
1208 return graphql.Null
1209 }
1210 if resTmp == nil {
1211 return graphql.Null
1212 }
1213 res := resTmp.(time.Time)
1214 return graphql.MarshalTime(res)
1215 })
1216}
1217
1218func (ec *executionContext) _LabelChangeOperation_added(ctx context.Context, field graphql.CollectedField, obj *operations.LabelChangeOperation) graphql.Marshaler {
1219 rctx := graphql.GetResolverContext(ctx)
1220 rctx.Object = "LabelChangeOperation"
1221 rctx.Args = nil
1222 rctx.Field = field
1223 rctx.PushField(field.Alias)
1224 defer rctx.Pop()
1225 res := obj.Added
1226 arr1 := graphql.Array{}
1227 for idx1 := range res {
1228 arr1 = append(arr1, func() graphql.Marshaler {
1229 rctx := graphql.GetResolverContext(ctx)
1230 rctx.PushIndex(idx1)
1231 defer rctx.Pop()
1232 return res[idx1]
1233 }())
1234 }
1235 return arr1
1236}
1237
1238func (ec *executionContext) _LabelChangeOperation_removed(ctx context.Context, field graphql.CollectedField, obj *operations.LabelChangeOperation) graphql.Marshaler {
1239 rctx := graphql.GetResolverContext(ctx)
1240 rctx.Object = "LabelChangeOperation"
1241 rctx.Args = nil
1242 rctx.Field = field
1243 rctx.PushField(field.Alias)
1244 defer rctx.Pop()
1245 res := obj.Removed
1246 arr1 := graphql.Array{}
1247 for idx1 := range res {
1248 arr1 = append(arr1, func() graphql.Marshaler {
1249 rctx := graphql.GetResolverContext(ctx)
1250 rctx.PushIndex(idx1)
1251 defer rctx.Pop()
1252 return res[idx1]
1253 }())
1254 }
1255 return arr1
1256}
1257
1258var mutationImplementors = []string{"Mutation"}
1259
1260// nolint: gocyclo, errcheck, gas, goconst
1261func (ec *executionContext) _Mutation(ctx context.Context, sel []query.Selection) graphql.Marshaler {
1262 fields := graphql.CollectFields(ec.Doc, sel, mutationImplementors, ec.Variables)
1263
1264 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{
1265 Object: "Mutation",
1266 })
1267
1268 out := graphql.NewOrderedMap(len(fields))
1269 for i, field := range fields {
1270 out.Keys[i] = field.Alias
1271
1272 switch field.Name {
1273 case "__typename":
1274 out.Values[i] = graphql.MarshalString("Mutation")
1275 case "newBug":
1276 out.Values[i] = ec._Mutation_newBug(ctx, field)
1277 case "addComment":
1278 out.Values[i] = ec._Mutation_addComment(ctx, field)
1279 case "changeLabels":
1280 out.Values[i] = ec._Mutation_changeLabels(ctx, field)
1281 case "open":
1282 out.Values[i] = ec._Mutation_open(ctx, field)
1283 case "close":
1284 out.Values[i] = ec._Mutation_close(ctx, field)
1285 case "setTitle":
1286 out.Values[i] = ec._Mutation_setTitle(ctx, field)
1287 case "commit":
1288 out.Values[i] = ec._Mutation_commit(ctx, field)
1289 default:
1290 panic("unknown field " + strconv.Quote(field.Name))
1291 }
1292 }
1293
1294 return out
1295}
1296
1297func (ec *executionContext) _Mutation_newBug(ctx context.Context, field graphql.CollectedField) graphql.Marshaler {
1298 args := map[string]interface{}{}
1299 var arg0 *string
1300 if tmp, ok := field.Args["repoRef"]; ok {
1301 var err error
1302 var ptr1 string
1303 if tmp != nil {
1304 ptr1, err = graphql.UnmarshalString(tmp)
1305 arg0 = &ptr1
1306 }
1307
1308 if err != nil {
1309 ec.Error(ctx, err)
1310 return graphql.Null
1311 }
1312 }
1313 args["repoRef"] = arg0
1314 var arg1 string
1315 if tmp, ok := field.Args["title"]; ok {
1316 var err error
1317 arg1, err = graphql.UnmarshalString(tmp)
1318 if err != nil {
1319 ec.Error(ctx, err)
1320 return graphql.Null
1321 }
1322 }
1323 args["title"] = arg1
1324 var arg2 string
1325 if tmp, ok := field.Args["message"]; ok {
1326 var err error
1327 arg2, err = graphql.UnmarshalString(tmp)
1328 if err != nil {
1329 ec.Error(ctx, err)
1330 return graphql.Null
1331 }
1332 }
1333 args["message"] = arg2
1334 var arg3 []util.Hash
1335 if tmp, ok := field.Args["files"]; ok {
1336 var err error
1337 var rawIf1 []interface{}
1338 if tmp != nil {
1339 if tmp1, ok := tmp.([]interface{}); ok {
1340 rawIf1 = tmp1
1341 }
1342 }
1343 arg3 = make([]util.Hash, len(rawIf1))
1344 for idx1 := range rawIf1 {
1345 err = (&arg3[idx1]).UnmarshalGQL(rawIf1[idx1])
1346 }
1347 if err != nil {
1348 ec.Error(ctx, err)
1349 return graphql.Null
1350 }
1351 }
1352 args["files"] = arg3
1353 rctx := graphql.GetResolverContext(ctx)
1354 rctx.Object = "Mutation"
1355 rctx.Args = args
1356 rctx.Field = field
1357 rctx.PushField(field.Alias)
1358 defer rctx.Pop()
1359 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
1360 return ec.resolvers.Mutation_newBug(ctx, args["repoRef"].(*string), args["title"].(string), args["message"].(string), args["files"].([]util.Hash))
1361 })
1362 if err != nil {
1363 ec.Error(ctx, err)
1364 return graphql.Null
1365 }
1366 if resTmp == nil {
1367 return graphql.Null
1368 }
1369 res := resTmp.(bug.Snapshot)
1370 return ec._Bug(ctx, field.Selections, &res)
1371}
1372
1373func (ec *executionContext) _Mutation_addComment(ctx context.Context, field graphql.CollectedField) graphql.Marshaler {
1374 args := map[string]interface{}{}
1375 var arg0 *string
1376 if tmp, ok := field.Args["repoRef"]; ok {
1377 var err error
1378 var ptr1 string
1379 if tmp != nil {
1380 ptr1, err = graphql.UnmarshalString(tmp)
1381 arg0 = &ptr1
1382 }
1383
1384 if err != nil {
1385 ec.Error(ctx, err)
1386 return graphql.Null
1387 }
1388 }
1389 args["repoRef"] = arg0
1390 var arg1 string
1391 if tmp, ok := field.Args["prefix"]; ok {
1392 var err error
1393 arg1, err = graphql.UnmarshalString(tmp)
1394 if err != nil {
1395 ec.Error(ctx, err)
1396 return graphql.Null
1397 }
1398 }
1399 args["prefix"] = arg1
1400 var arg2 string
1401 if tmp, ok := field.Args["message"]; ok {
1402 var err error
1403 arg2, err = graphql.UnmarshalString(tmp)
1404 if err != nil {
1405 ec.Error(ctx, err)
1406 return graphql.Null
1407 }
1408 }
1409 args["message"] = arg2
1410 var arg3 []util.Hash
1411 if tmp, ok := field.Args["files"]; ok {
1412 var err error
1413 var rawIf1 []interface{}
1414 if tmp != nil {
1415 if tmp1, ok := tmp.([]interface{}); ok {
1416 rawIf1 = tmp1
1417 }
1418 }
1419 arg3 = make([]util.Hash, len(rawIf1))
1420 for idx1 := range rawIf1 {
1421 err = (&arg3[idx1]).UnmarshalGQL(rawIf1[idx1])
1422 }
1423 if err != nil {
1424 ec.Error(ctx, err)
1425 return graphql.Null
1426 }
1427 }
1428 args["files"] = arg3
1429 rctx := graphql.GetResolverContext(ctx)
1430 rctx.Object = "Mutation"
1431 rctx.Args = args
1432 rctx.Field = field
1433 rctx.PushField(field.Alias)
1434 defer rctx.Pop()
1435 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
1436 return ec.resolvers.Mutation_addComment(ctx, args["repoRef"].(*string), args["prefix"].(string), args["message"].(string), args["files"].([]util.Hash))
1437 })
1438 if err != nil {
1439 ec.Error(ctx, err)
1440 return graphql.Null
1441 }
1442 if resTmp == nil {
1443 return graphql.Null
1444 }
1445 res := resTmp.(bug.Snapshot)
1446 return ec._Bug(ctx, field.Selections, &res)
1447}
1448
1449func (ec *executionContext) _Mutation_changeLabels(ctx context.Context, field graphql.CollectedField) graphql.Marshaler {
1450 args := map[string]interface{}{}
1451 var arg0 *string
1452 if tmp, ok := field.Args["repoRef"]; ok {
1453 var err error
1454 var ptr1 string
1455 if tmp != nil {
1456 ptr1, err = graphql.UnmarshalString(tmp)
1457 arg0 = &ptr1
1458 }
1459
1460 if err != nil {
1461 ec.Error(ctx, err)
1462 return graphql.Null
1463 }
1464 }
1465 args["repoRef"] = arg0
1466 var arg1 string
1467 if tmp, ok := field.Args["prefix"]; ok {
1468 var err error
1469 arg1, err = graphql.UnmarshalString(tmp)
1470 if err != nil {
1471 ec.Error(ctx, err)
1472 return graphql.Null
1473 }
1474 }
1475 args["prefix"] = arg1
1476 var arg2 []string
1477 if tmp, ok := field.Args["added"]; ok {
1478 var err error
1479 var rawIf1 []interface{}
1480 if tmp != nil {
1481 if tmp1, ok := tmp.([]interface{}); ok {
1482 rawIf1 = tmp1
1483 }
1484 }
1485 arg2 = make([]string, len(rawIf1))
1486 for idx1 := range rawIf1 {
1487 arg2[idx1], err = graphql.UnmarshalString(rawIf1[idx1])
1488 }
1489 if err != nil {
1490 ec.Error(ctx, err)
1491 return graphql.Null
1492 }
1493 }
1494 args["added"] = arg2
1495 var arg3 []string
1496 if tmp, ok := field.Args["removed"]; ok {
1497 var err error
1498 var rawIf1 []interface{}
1499 if tmp != nil {
1500 if tmp1, ok := tmp.([]interface{}); ok {
1501 rawIf1 = tmp1
1502 }
1503 }
1504 arg3 = make([]string, len(rawIf1))
1505 for idx1 := range rawIf1 {
1506 arg3[idx1], err = graphql.UnmarshalString(rawIf1[idx1])
1507 }
1508 if err != nil {
1509 ec.Error(ctx, err)
1510 return graphql.Null
1511 }
1512 }
1513 args["removed"] = arg3
1514 rctx := graphql.GetResolverContext(ctx)
1515 rctx.Object = "Mutation"
1516 rctx.Args = args
1517 rctx.Field = field
1518 rctx.PushField(field.Alias)
1519 defer rctx.Pop()
1520 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
1521 return ec.resolvers.Mutation_changeLabels(ctx, args["repoRef"].(*string), args["prefix"].(string), args["added"].([]string), args["removed"].([]string))
1522 })
1523 if err != nil {
1524 ec.Error(ctx, err)
1525 return graphql.Null
1526 }
1527 if resTmp == nil {
1528 return graphql.Null
1529 }
1530 res := resTmp.(bug.Snapshot)
1531 return ec._Bug(ctx, field.Selections, &res)
1532}
1533
1534func (ec *executionContext) _Mutation_open(ctx context.Context, field graphql.CollectedField) graphql.Marshaler {
1535 args := map[string]interface{}{}
1536 var arg0 *string
1537 if tmp, ok := field.Args["repoRef"]; ok {
1538 var err error
1539 var ptr1 string
1540 if tmp != nil {
1541 ptr1, err = graphql.UnmarshalString(tmp)
1542 arg0 = &ptr1
1543 }
1544
1545 if err != nil {
1546 ec.Error(ctx, err)
1547 return graphql.Null
1548 }
1549 }
1550 args["repoRef"] = arg0
1551 var arg1 string
1552 if tmp, ok := field.Args["prefix"]; ok {
1553 var err error
1554 arg1, err = graphql.UnmarshalString(tmp)
1555 if err != nil {
1556 ec.Error(ctx, err)
1557 return graphql.Null
1558 }
1559 }
1560 args["prefix"] = arg1
1561 rctx := graphql.GetResolverContext(ctx)
1562 rctx.Object = "Mutation"
1563 rctx.Args = args
1564 rctx.Field = field
1565 rctx.PushField(field.Alias)
1566 defer rctx.Pop()
1567 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
1568 return ec.resolvers.Mutation_open(ctx, args["repoRef"].(*string), args["prefix"].(string))
1569 })
1570 if err != nil {
1571 ec.Error(ctx, err)
1572 return graphql.Null
1573 }
1574 if resTmp == nil {
1575 return graphql.Null
1576 }
1577 res := resTmp.(bug.Snapshot)
1578 return ec._Bug(ctx, field.Selections, &res)
1579}
1580
1581func (ec *executionContext) _Mutation_close(ctx context.Context, field graphql.CollectedField) graphql.Marshaler {
1582 args := map[string]interface{}{}
1583 var arg0 *string
1584 if tmp, ok := field.Args["repoRef"]; ok {
1585 var err error
1586 var ptr1 string
1587 if tmp != nil {
1588 ptr1, err = graphql.UnmarshalString(tmp)
1589 arg0 = &ptr1
1590 }
1591
1592 if err != nil {
1593 ec.Error(ctx, err)
1594 return graphql.Null
1595 }
1596 }
1597 args["repoRef"] = arg0
1598 var arg1 string
1599 if tmp, ok := field.Args["prefix"]; ok {
1600 var err error
1601 arg1, err = graphql.UnmarshalString(tmp)
1602 if err != nil {
1603 ec.Error(ctx, err)
1604 return graphql.Null
1605 }
1606 }
1607 args["prefix"] = arg1
1608 rctx := graphql.GetResolverContext(ctx)
1609 rctx.Object = "Mutation"
1610 rctx.Args = args
1611 rctx.Field = field
1612 rctx.PushField(field.Alias)
1613 defer rctx.Pop()
1614 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
1615 return ec.resolvers.Mutation_close(ctx, args["repoRef"].(*string), args["prefix"].(string))
1616 })
1617 if err != nil {
1618 ec.Error(ctx, err)
1619 return graphql.Null
1620 }
1621 if resTmp == nil {
1622 return graphql.Null
1623 }
1624 res := resTmp.(bug.Snapshot)
1625 return ec._Bug(ctx, field.Selections, &res)
1626}
1627
1628func (ec *executionContext) _Mutation_setTitle(ctx context.Context, field graphql.CollectedField) graphql.Marshaler {
1629 args := map[string]interface{}{}
1630 var arg0 *string
1631 if tmp, ok := field.Args["repoRef"]; ok {
1632 var err error
1633 var ptr1 string
1634 if tmp != nil {
1635 ptr1, err = graphql.UnmarshalString(tmp)
1636 arg0 = &ptr1
1637 }
1638
1639 if err != nil {
1640 ec.Error(ctx, err)
1641 return graphql.Null
1642 }
1643 }
1644 args["repoRef"] = arg0
1645 var arg1 string
1646 if tmp, ok := field.Args["prefix"]; ok {
1647 var err error
1648 arg1, err = graphql.UnmarshalString(tmp)
1649 if err != nil {
1650 ec.Error(ctx, err)
1651 return graphql.Null
1652 }
1653 }
1654 args["prefix"] = arg1
1655 var arg2 string
1656 if tmp, ok := field.Args["title"]; ok {
1657 var err error
1658 arg2, err = graphql.UnmarshalString(tmp)
1659 if err != nil {
1660 ec.Error(ctx, err)
1661 return graphql.Null
1662 }
1663 }
1664 args["title"] = arg2
1665 rctx := graphql.GetResolverContext(ctx)
1666 rctx.Object = "Mutation"
1667 rctx.Args = args
1668 rctx.Field = field
1669 rctx.PushField(field.Alias)
1670 defer rctx.Pop()
1671 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
1672 return ec.resolvers.Mutation_setTitle(ctx, args["repoRef"].(*string), args["prefix"].(string), args["title"].(string))
1673 })
1674 if err != nil {
1675 ec.Error(ctx, err)
1676 return graphql.Null
1677 }
1678 if resTmp == nil {
1679 return graphql.Null
1680 }
1681 res := resTmp.(bug.Snapshot)
1682 return ec._Bug(ctx, field.Selections, &res)
1683}
1684
1685func (ec *executionContext) _Mutation_commit(ctx context.Context, field graphql.CollectedField) graphql.Marshaler {
1686 args := map[string]interface{}{}
1687 var arg0 *string
1688 if tmp, ok := field.Args["repoRef"]; ok {
1689 var err error
1690 var ptr1 string
1691 if tmp != nil {
1692 ptr1, err = graphql.UnmarshalString(tmp)
1693 arg0 = &ptr1
1694 }
1695
1696 if err != nil {
1697 ec.Error(ctx, err)
1698 return graphql.Null
1699 }
1700 }
1701 args["repoRef"] = arg0
1702 var arg1 string
1703 if tmp, ok := field.Args["prefix"]; ok {
1704 var err error
1705 arg1, err = graphql.UnmarshalString(tmp)
1706 if err != nil {
1707 ec.Error(ctx, err)
1708 return graphql.Null
1709 }
1710 }
1711 args["prefix"] = arg1
1712 rctx := graphql.GetResolverContext(ctx)
1713 rctx.Object = "Mutation"
1714 rctx.Args = args
1715 rctx.Field = field
1716 rctx.PushField(field.Alias)
1717 defer rctx.Pop()
1718 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
1719 return ec.resolvers.Mutation_commit(ctx, args["repoRef"].(*string), args["prefix"].(string))
1720 })
1721 if err != nil {
1722 ec.Error(ctx, err)
1723 return graphql.Null
1724 }
1725 if resTmp == nil {
1726 return graphql.Null
1727 }
1728 res := resTmp.(bug.Snapshot)
1729 return ec._Bug(ctx, field.Selections, &res)
1730}
1731
1732var operationConnectionImplementors = []string{"OperationConnection"}
1733
1734// nolint: gocyclo, errcheck, gas, goconst
1735func (ec *executionContext) _OperationConnection(ctx context.Context, sel []query.Selection, obj *models.OperationConnection) graphql.Marshaler {
1736 fields := graphql.CollectFields(ec.Doc, sel, operationConnectionImplementors, ec.Variables)
1737
1738 out := graphql.NewOrderedMap(len(fields))
1739 for i, field := range fields {
1740 out.Keys[i] = field.Alias
1741
1742 switch field.Name {
1743 case "__typename":
1744 out.Values[i] = graphql.MarshalString("OperationConnection")
1745 case "edges":
1746 out.Values[i] = ec._OperationConnection_edges(ctx, field, obj)
1747 case "nodes":
1748 out.Values[i] = ec._OperationConnection_nodes(ctx, field, obj)
1749 case "pageInfo":
1750 out.Values[i] = ec._OperationConnection_pageInfo(ctx, field, obj)
1751 case "totalCount":
1752 out.Values[i] = ec._OperationConnection_totalCount(ctx, field, obj)
1753 default:
1754 panic("unknown field " + strconv.Quote(field.Name))
1755 }
1756 }
1757
1758 return out
1759}
1760
1761func (ec *executionContext) _OperationConnection_edges(ctx context.Context, field graphql.CollectedField, obj *models.OperationConnection) graphql.Marshaler {
1762 rctx := graphql.GetResolverContext(ctx)
1763 rctx.Object = "OperationConnection"
1764 rctx.Args = nil
1765 rctx.Field = field
1766 rctx.PushField(field.Alias)
1767 defer rctx.Pop()
1768 res := obj.Edges
1769 arr1 := graphql.Array{}
1770 for idx1 := range res {
1771 arr1 = append(arr1, func() graphql.Marshaler {
1772 rctx := graphql.GetResolverContext(ctx)
1773 rctx.PushIndex(idx1)
1774 defer rctx.Pop()
1775 return ec._OperationEdge(ctx, field.Selections, &res[idx1])
1776 }())
1777 }
1778 return arr1
1779}
1780
1781func (ec *executionContext) _OperationConnection_nodes(ctx context.Context, field graphql.CollectedField, obj *models.OperationConnection) graphql.Marshaler {
1782 rctx := graphql.GetResolverContext(ctx)
1783 rctx.Object = "OperationConnection"
1784 rctx.Args = nil
1785 rctx.Field = field
1786 rctx.PushField(field.Alias)
1787 defer rctx.Pop()
1788 res := obj.Nodes
1789 arr1 := graphql.Array{}
1790 for idx1 := range res {
1791 arr1 = append(arr1, func() graphql.Marshaler {
1792 rctx := graphql.GetResolverContext(ctx)
1793 rctx.PushIndex(idx1)
1794 defer rctx.Pop()
1795 return ec._Operation(ctx, field.Selections, &res[idx1])
1796 }())
1797 }
1798 return arr1
1799}
1800
1801func (ec *executionContext) _OperationConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *models.OperationConnection) graphql.Marshaler {
1802 rctx := graphql.GetResolverContext(ctx)
1803 rctx.Object = "OperationConnection"
1804 rctx.Args = nil
1805 rctx.Field = field
1806 rctx.PushField(field.Alias)
1807 defer rctx.Pop()
1808 res := obj.PageInfo
1809 return ec._PageInfo(ctx, field.Selections, &res)
1810}
1811
1812func (ec *executionContext) _OperationConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *models.OperationConnection) graphql.Marshaler {
1813 rctx := graphql.GetResolverContext(ctx)
1814 rctx.Object = "OperationConnection"
1815 rctx.Args = nil
1816 rctx.Field = field
1817 rctx.PushField(field.Alias)
1818 defer rctx.Pop()
1819 res := obj.TotalCount
1820 return graphql.MarshalInt(res)
1821}
1822
1823var operationEdgeImplementors = []string{"OperationEdge"}
1824
1825// nolint: gocyclo, errcheck, gas, goconst
1826func (ec *executionContext) _OperationEdge(ctx context.Context, sel []query.Selection, obj *models.OperationEdge) graphql.Marshaler {
1827 fields := graphql.CollectFields(ec.Doc, sel, operationEdgeImplementors, ec.Variables)
1828
1829 out := graphql.NewOrderedMap(len(fields))
1830 for i, field := range fields {
1831 out.Keys[i] = field.Alias
1832
1833 switch field.Name {
1834 case "__typename":
1835 out.Values[i] = graphql.MarshalString("OperationEdge")
1836 case "cursor":
1837 out.Values[i] = ec._OperationEdge_cursor(ctx, field, obj)
1838 case "node":
1839 out.Values[i] = ec._OperationEdge_node(ctx, field, obj)
1840 default:
1841 panic("unknown field " + strconv.Quote(field.Name))
1842 }
1843 }
1844
1845 return out
1846}
1847
1848func (ec *executionContext) _OperationEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *models.OperationEdge) graphql.Marshaler {
1849 rctx := graphql.GetResolverContext(ctx)
1850 rctx.Object = "OperationEdge"
1851 rctx.Args = nil
1852 rctx.Field = field
1853 rctx.PushField(field.Alias)
1854 defer rctx.Pop()
1855 res := obj.Cursor
1856 return graphql.MarshalString(res)
1857}
1858
1859func (ec *executionContext) _OperationEdge_node(ctx context.Context, field graphql.CollectedField, obj *models.OperationEdge) graphql.Marshaler {
1860 rctx := graphql.GetResolverContext(ctx)
1861 rctx.Object = "OperationEdge"
1862 rctx.Args = nil
1863 rctx.Field = field
1864 rctx.PushField(field.Alias)
1865 defer rctx.Pop()
1866 res := obj.Node
1867 return ec._Operation(ctx, field.Selections, &res)
1868}
1869
1870var pageInfoImplementors = []string{"PageInfo"}
1871
1872// nolint: gocyclo, errcheck, gas, goconst
1873func (ec *executionContext) _PageInfo(ctx context.Context, sel []query.Selection, obj *models.PageInfo) graphql.Marshaler {
1874 fields := graphql.CollectFields(ec.Doc, sel, pageInfoImplementors, ec.Variables)
1875
1876 out := graphql.NewOrderedMap(len(fields))
1877 for i, field := range fields {
1878 out.Keys[i] = field.Alias
1879
1880 switch field.Name {
1881 case "__typename":
1882 out.Values[i] = graphql.MarshalString("PageInfo")
1883 case "hasNextPage":
1884 out.Values[i] = ec._PageInfo_hasNextPage(ctx, field, obj)
1885 case "hasPreviousPage":
1886 out.Values[i] = ec._PageInfo_hasPreviousPage(ctx, field, obj)
1887 default:
1888 panic("unknown field " + strconv.Quote(field.Name))
1889 }
1890 }
1891
1892 return out
1893}
1894
1895func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *models.PageInfo) graphql.Marshaler {
1896 rctx := graphql.GetResolverContext(ctx)
1897 rctx.Object = "PageInfo"
1898 rctx.Args = nil
1899 rctx.Field = field
1900 rctx.PushField(field.Alias)
1901 defer rctx.Pop()
1902 res := obj.HasNextPage
1903 return graphql.MarshalBoolean(res)
1904}
1905
1906func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField, obj *models.PageInfo) graphql.Marshaler {
1907 rctx := graphql.GetResolverContext(ctx)
1908 rctx.Object = "PageInfo"
1909 rctx.Args = nil
1910 rctx.Field = field
1911 rctx.PushField(field.Alias)
1912 defer rctx.Pop()
1913 res := obj.HasPreviousPage
1914 return graphql.MarshalBoolean(res)
1915}
1916
1917var personImplementors = []string{"Person"}
1918
1919// nolint: gocyclo, errcheck, gas, goconst
1920func (ec *executionContext) _Person(ctx context.Context, sel []query.Selection, obj *bug.Person) graphql.Marshaler {
1921 fields := graphql.CollectFields(ec.Doc, sel, personImplementors, ec.Variables)
1922
1923 out := graphql.NewOrderedMap(len(fields))
1924 for i, field := range fields {
1925 out.Keys[i] = field.Alias
1926
1927 switch field.Name {
1928 case "__typename":
1929 out.Values[i] = graphql.MarshalString("Person")
1930 case "email":
1931 out.Values[i] = ec._Person_email(ctx, field, obj)
1932 case "name":
1933 out.Values[i] = ec._Person_name(ctx, field, obj)
1934 default:
1935 panic("unknown field " + strconv.Quote(field.Name))
1936 }
1937 }
1938
1939 return out
1940}
1941
1942func (ec *executionContext) _Person_email(ctx context.Context, field graphql.CollectedField, obj *bug.Person) graphql.Marshaler {
1943 rctx := graphql.GetResolverContext(ctx)
1944 rctx.Object = "Person"
1945 rctx.Args = nil
1946 rctx.Field = field
1947 rctx.PushField(field.Alias)
1948 defer rctx.Pop()
1949 res := obj.Email
1950 return graphql.MarshalString(res)
1951}
1952
1953func (ec *executionContext) _Person_name(ctx context.Context, field graphql.CollectedField, obj *bug.Person) graphql.Marshaler {
1954 rctx := graphql.GetResolverContext(ctx)
1955 rctx.Object = "Person"
1956 rctx.Args = nil
1957 rctx.Field = field
1958 rctx.PushField(field.Alias)
1959 defer rctx.Pop()
1960 res := obj.Name
1961 return graphql.MarshalString(res)
1962}
1963
1964var queryImplementors = []string{"Query"}
1965
1966// nolint: gocyclo, errcheck, gas, goconst
1967func (ec *executionContext) _Query(ctx context.Context, sel []query.Selection) graphql.Marshaler {
1968 fields := graphql.CollectFields(ec.Doc, sel, queryImplementors, ec.Variables)
1969
1970 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{
1971 Object: "Query",
1972 })
1973
1974 out := graphql.NewOrderedMap(len(fields))
1975 for i, field := range fields {
1976 out.Keys[i] = field.Alias
1977
1978 switch field.Name {
1979 case "__typename":
1980 out.Values[i] = graphql.MarshalString("Query")
1981 case "defaultRepository":
1982 out.Values[i] = ec._Query_defaultRepository(ctx, field)
1983 case "repository":
1984 out.Values[i] = ec._Query_repository(ctx, field)
1985 case "__schema":
1986 out.Values[i] = ec._Query___schema(ctx, field)
1987 case "__type":
1988 out.Values[i] = ec._Query___type(ctx, field)
1989 default:
1990 panic("unknown field " + strconv.Quote(field.Name))
1991 }
1992 }
1993
1994 return out
1995}
1996
1997func (ec *executionContext) _Query_defaultRepository(ctx context.Context, field graphql.CollectedField) graphql.Marshaler {
1998 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{
1999 Object: "Query",
2000 Args: nil,
2001 Field: field,
2002 })
2003 return graphql.Defer(func() (ret graphql.Marshaler) {
2004 defer func() {
2005 if r := recover(); r != nil {
2006 userErr := ec.Recover(ctx, r)
2007 ec.Error(ctx, userErr)
2008 ret = graphql.Null
2009 }
2010 }()
2011
2012 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
2013 return ec.resolvers.Query_defaultRepository(ctx)
2014 })
2015 if err != nil {
2016 ec.Error(ctx, err)
2017 return graphql.Null
2018 }
2019 if resTmp == nil {
2020 return graphql.Null
2021 }
2022 res := resTmp.(*models.Repository)
2023 if res == nil {
2024 return graphql.Null
2025 }
2026 return ec._Repository(ctx, field.Selections, res)
2027 })
2028}
2029
2030func (ec *executionContext) _Query_repository(ctx context.Context, field graphql.CollectedField) graphql.Marshaler {
2031 args := map[string]interface{}{}
2032 var arg0 string
2033 if tmp, ok := field.Args["id"]; ok {
2034 var err error
2035 arg0, err = graphql.UnmarshalString(tmp)
2036 if err != nil {
2037 ec.Error(ctx, err)
2038 return graphql.Null
2039 }
2040 }
2041 args["id"] = arg0
2042 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{
2043 Object: "Query",
2044 Args: args,
2045 Field: field,
2046 })
2047 return graphql.Defer(func() (ret graphql.Marshaler) {
2048 defer func() {
2049 if r := recover(); r != nil {
2050 userErr := ec.Recover(ctx, r)
2051 ec.Error(ctx, userErr)
2052 ret = graphql.Null
2053 }
2054 }()
2055
2056 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
2057 return ec.resolvers.Query_repository(ctx, args["id"].(string))
2058 })
2059 if err != nil {
2060 ec.Error(ctx, err)
2061 return graphql.Null
2062 }
2063 if resTmp == nil {
2064 return graphql.Null
2065 }
2066 res := resTmp.(*models.Repository)
2067 if res == nil {
2068 return graphql.Null
2069 }
2070 return ec._Repository(ctx, field.Selections, res)
2071 })
2072}
2073
2074func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler {
2075 rctx := graphql.GetResolverContext(ctx)
2076 rctx.Object = "Query"
2077 rctx.Args = nil
2078 rctx.Field = field
2079 rctx.PushField(field.Alias)
2080 defer rctx.Pop()
2081 res := ec.introspectSchema()
2082 if res == nil {
2083 return graphql.Null
2084 }
2085 return ec.___Schema(ctx, field.Selections, res)
2086}
2087
2088func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler {
2089 args := map[string]interface{}{}
2090 var arg0 string
2091 if tmp, ok := field.Args["name"]; ok {
2092 var err error
2093 arg0, err = graphql.UnmarshalString(tmp)
2094 if err != nil {
2095 ec.Error(ctx, err)
2096 return graphql.Null
2097 }
2098 }
2099 args["name"] = arg0
2100 rctx := graphql.GetResolverContext(ctx)
2101 rctx.Object = "Query"
2102 rctx.Args = args
2103 rctx.Field = field
2104 rctx.PushField(field.Alias)
2105 defer rctx.Pop()
2106 res := ec.introspectType(args["name"].(string))
2107 if res == nil {
2108 return graphql.Null
2109 }
2110 return ec.___Type(ctx, field.Selections, res)
2111}
2112
2113var repositoryImplementors = []string{"Repository"}
2114
2115// nolint: gocyclo, errcheck, gas, goconst
2116func (ec *executionContext) _Repository(ctx context.Context, sel []query.Selection, obj *models.Repository) graphql.Marshaler {
2117 fields := graphql.CollectFields(ec.Doc, sel, repositoryImplementors, ec.Variables)
2118
2119 out := graphql.NewOrderedMap(len(fields))
2120 for i, field := range fields {
2121 out.Keys[i] = field.Alias
2122
2123 switch field.Name {
2124 case "__typename":
2125 out.Values[i] = graphql.MarshalString("Repository")
2126 case "allBugs":
2127 out.Values[i] = ec._Repository_allBugs(ctx, field, obj)
2128 case "bug":
2129 out.Values[i] = ec._Repository_bug(ctx, field, obj)
2130 default:
2131 panic("unknown field " + strconv.Quote(field.Name))
2132 }
2133 }
2134
2135 return out
2136}
2137
2138func (ec *executionContext) _Repository_allBugs(ctx context.Context, field graphql.CollectedField, obj *models.Repository) graphql.Marshaler {
2139 args := map[string]interface{}{}
2140 var arg0 *string
2141 if tmp, ok := field.Args["after"]; ok {
2142 var err error
2143 var ptr1 string
2144 if tmp != nil {
2145 ptr1, err = graphql.UnmarshalString(tmp)
2146 arg0 = &ptr1
2147 }
2148
2149 if err != nil {
2150 ec.Error(ctx, err)
2151 return graphql.Null
2152 }
2153 }
2154 args["after"] = arg0
2155 var arg1 *string
2156 if tmp, ok := field.Args["before"]; ok {
2157 var err error
2158 var ptr1 string
2159 if tmp != nil {
2160 ptr1, err = graphql.UnmarshalString(tmp)
2161 arg1 = &ptr1
2162 }
2163
2164 if err != nil {
2165 ec.Error(ctx, err)
2166 return graphql.Null
2167 }
2168 }
2169 args["before"] = arg1
2170 var arg2 *int
2171 if tmp, ok := field.Args["first"]; ok {
2172 var err error
2173 var ptr1 int
2174 if tmp != nil {
2175 ptr1, err = graphql.UnmarshalInt(tmp)
2176 arg2 = &ptr1
2177 }
2178
2179 if err != nil {
2180 ec.Error(ctx, err)
2181 return graphql.Null
2182 }
2183 }
2184 args["first"] = arg2
2185 var arg3 *int
2186 if tmp, ok := field.Args["last"]; ok {
2187 var err error
2188 var ptr1 int
2189 if tmp != nil {
2190 ptr1, err = graphql.UnmarshalInt(tmp)
2191 arg3 = &ptr1
2192 }
2193
2194 if err != nil {
2195 ec.Error(ctx, err)
2196 return graphql.Null
2197 }
2198 }
2199 args["last"] = arg3
2200 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{
2201 Object: "Repository",
2202 Args: args,
2203 Field: field,
2204 })
2205 return graphql.Defer(func() (ret graphql.Marshaler) {
2206 defer func() {
2207 if r := recover(); r != nil {
2208 userErr := ec.Recover(ctx, r)
2209 ec.Error(ctx, userErr)
2210 ret = graphql.Null
2211 }
2212 }()
2213
2214 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
2215 return ec.resolvers.Repository_allBugs(ctx, obj, args["after"].(*string), args["before"].(*string), args["first"].(*int), args["last"].(*int))
2216 })
2217 if err != nil {
2218 ec.Error(ctx, err)
2219 return graphql.Null
2220 }
2221 if resTmp == nil {
2222 return graphql.Null
2223 }
2224 res := resTmp.(models.BugConnection)
2225 return ec._BugConnection(ctx, field.Selections, &res)
2226 })
2227}
2228
2229func (ec *executionContext) _Repository_bug(ctx context.Context, field graphql.CollectedField, obj *models.Repository) graphql.Marshaler {
2230 args := map[string]interface{}{}
2231 var arg0 string
2232 if tmp, ok := field.Args["prefix"]; ok {
2233 var err error
2234 arg0, err = graphql.UnmarshalString(tmp)
2235 if err != nil {
2236 ec.Error(ctx, err)
2237 return graphql.Null
2238 }
2239 }
2240 args["prefix"] = arg0
2241 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{
2242 Object: "Repository",
2243 Args: args,
2244 Field: field,
2245 })
2246 return graphql.Defer(func() (ret graphql.Marshaler) {
2247 defer func() {
2248 if r := recover(); r != nil {
2249 userErr := ec.Recover(ctx, r)
2250 ec.Error(ctx, userErr)
2251 ret = graphql.Null
2252 }
2253 }()
2254
2255 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
2256 return ec.resolvers.Repository_bug(ctx, obj, args["prefix"].(string))
2257 })
2258 if err != nil {
2259 ec.Error(ctx, err)
2260 return graphql.Null
2261 }
2262 if resTmp == nil {
2263 return graphql.Null
2264 }
2265 res := resTmp.(*bug.Snapshot)
2266 if res == nil {
2267 return graphql.Null
2268 }
2269 return ec._Bug(ctx, field.Selections, res)
2270 })
2271}
2272
2273var setStatusOperationImplementors = []string{"SetStatusOperation", "Operation", "Authored"}
2274
2275// nolint: gocyclo, errcheck, gas, goconst
2276func (ec *executionContext) _SetStatusOperation(ctx context.Context, sel []query.Selection, obj *operations.SetStatusOperation) graphql.Marshaler {
2277 fields := graphql.CollectFields(ec.Doc, sel, setStatusOperationImplementors, ec.Variables)
2278
2279 out := graphql.NewOrderedMap(len(fields))
2280 for i, field := range fields {
2281 out.Keys[i] = field.Alias
2282
2283 switch field.Name {
2284 case "__typename":
2285 out.Values[i] = graphql.MarshalString("SetStatusOperation")
2286 case "author":
2287 out.Values[i] = ec._SetStatusOperation_author(ctx, field, obj)
2288 case "date":
2289 out.Values[i] = ec._SetStatusOperation_date(ctx, field, obj)
2290 case "status":
2291 out.Values[i] = ec._SetStatusOperation_status(ctx, field, obj)
2292 default:
2293 panic("unknown field " + strconv.Quote(field.Name))
2294 }
2295 }
2296
2297 return out
2298}
2299
2300func (ec *executionContext) _SetStatusOperation_author(ctx context.Context, field graphql.CollectedField, obj *operations.SetStatusOperation) graphql.Marshaler {
2301 rctx := graphql.GetResolverContext(ctx)
2302 rctx.Object = "SetStatusOperation"
2303 rctx.Args = nil
2304 rctx.Field = field
2305 rctx.PushField(field.Alias)
2306 defer rctx.Pop()
2307 res := obj.Author
2308 return ec._Person(ctx, field.Selections, &res)
2309}
2310
2311func (ec *executionContext) _SetStatusOperation_date(ctx context.Context, field graphql.CollectedField, obj *operations.SetStatusOperation) graphql.Marshaler {
2312 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{
2313 Object: "SetStatusOperation",
2314 Args: nil,
2315 Field: field,
2316 })
2317 return graphql.Defer(func() (ret graphql.Marshaler) {
2318 defer func() {
2319 if r := recover(); r != nil {
2320 userErr := ec.Recover(ctx, r)
2321 ec.Error(ctx, userErr)
2322 ret = graphql.Null
2323 }
2324 }()
2325
2326 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
2327 return ec.resolvers.SetStatusOperation_date(ctx, obj)
2328 })
2329 if err != nil {
2330 ec.Error(ctx, err)
2331 return graphql.Null
2332 }
2333 if resTmp == nil {
2334 return graphql.Null
2335 }
2336 res := resTmp.(time.Time)
2337 return graphql.MarshalTime(res)
2338 })
2339}
2340
2341func (ec *executionContext) _SetStatusOperation_status(ctx context.Context, field graphql.CollectedField, obj *operations.SetStatusOperation) graphql.Marshaler {
2342 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{
2343 Object: "SetStatusOperation",
2344 Args: nil,
2345 Field: field,
2346 })
2347 return graphql.Defer(func() (ret graphql.Marshaler) {
2348 defer func() {
2349 if r := recover(); r != nil {
2350 userErr := ec.Recover(ctx, r)
2351 ec.Error(ctx, userErr)
2352 ret = graphql.Null
2353 }
2354 }()
2355
2356 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
2357 return ec.resolvers.SetStatusOperation_status(ctx, obj)
2358 })
2359 if err != nil {
2360 ec.Error(ctx, err)
2361 return graphql.Null
2362 }
2363 if resTmp == nil {
2364 return graphql.Null
2365 }
2366 res := resTmp.(models.Status)
2367 return res
2368 })
2369}
2370
2371var setTitleOperationImplementors = []string{"SetTitleOperation", "Operation", "Authored"}
2372
2373// nolint: gocyclo, errcheck, gas, goconst
2374func (ec *executionContext) _SetTitleOperation(ctx context.Context, sel []query.Selection, obj *operations.SetTitleOperation) graphql.Marshaler {
2375 fields := graphql.CollectFields(ec.Doc, sel, setTitleOperationImplementors, ec.Variables)
2376
2377 out := graphql.NewOrderedMap(len(fields))
2378 for i, field := range fields {
2379 out.Keys[i] = field.Alias
2380
2381 switch field.Name {
2382 case "__typename":
2383 out.Values[i] = graphql.MarshalString("SetTitleOperation")
2384 case "author":
2385 out.Values[i] = ec._SetTitleOperation_author(ctx, field, obj)
2386 case "date":
2387 out.Values[i] = ec._SetTitleOperation_date(ctx, field, obj)
2388 case "title":
2389 out.Values[i] = ec._SetTitleOperation_title(ctx, field, obj)
2390 default:
2391 panic("unknown field " + strconv.Quote(field.Name))
2392 }
2393 }
2394
2395 return out
2396}
2397
2398func (ec *executionContext) _SetTitleOperation_author(ctx context.Context, field graphql.CollectedField, obj *operations.SetTitleOperation) graphql.Marshaler {
2399 rctx := graphql.GetResolverContext(ctx)
2400 rctx.Object = "SetTitleOperation"
2401 rctx.Args = nil
2402 rctx.Field = field
2403 rctx.PushField(field.Alias)
2404 defer rctx.Pop()
2405 res := obj.Author
2406 return ec._Person(ctx, field.Selections, &res)
2407}
2408
2409func (ec *executionContext) _SetTitleOperation_date(ctx context.Context, field graphql.CollectedField, obj *operations.SetTitleOperation) graphql.Marshaler {
2410 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{
2411 Object: "SetTitleOperation",
2412 Args: nil,
2413 Field: field,
2414 })
2415 return graphql.Defer(func() (ret graphql.Marshaler) {
2416 defer func() {
2417 if r := recover(); r != nil {
2418 userErr := ec.Recover(ctx, r)
2419 ec.Error(ctx, userErr)
2420 ret = graphql.Null
2421 }
2422 }()
2423
2424 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
2425 return ec.resolvers.SetTitleOperation_date(ctx, obj)
2426 })
2427 if err != nil {
2428 ec.Error(ctx, err)
2429 return graphql.Null
2430 }
2431 if resTmp == nil {
2432 return graphql.Null
2433 }
2434 res := resTmp.(time.Time)
2435 return graphql.MarshalTime(res)
2436 })
2437}
2438
2439func (ec *executionContext) _SetTitleOperation_title(ctx context.Context, field graphql.CollectedField, obj *operations.SetTitleOperation) graphql.Marshaler {
2440 rctx := graphql.GetResolverContext(ctx)
2441 rctx.Object = "SetTitleOperation"
2442 rctx.Args = nil
2443 rctx.Field = field
2444 rctx.PushField(field.Alias)
2445 defer rctx.Pop()
2446 res := obj.Title
2447 return graphql.MarshalString(res)
2448}
2449
2450var __DirectiveImplementors = []string{"__Directive"}
2451
2452// nolint: gocyclo, errcheck, gas, goconst
2453func (ec *executionContext) ___Directive(ctx context.Context, sel []query.Selection, obj *introspection.Directive) graphql.Marshaler {
2454 fields := graphql.CollectFields(ec.Doc, sel, __DirectiveImplementors, ec.Variables)
2455
2456 out := graphql.NewOrderedMap(len(fields))
2457 for i, field := range fields {
2458 out.Keys[i] = field.Alias
2459
2460 switch field.Name {
2461 case "__typename":
2462 out.Values[i] = graphql.MarshalString("__Directive")
2463 case "name":
2464 out.Values[i] = ec.___Directive_name(ctx, field, obj)
2465 case "description":
2466 out.Values[i] = ec.___Directive_description(ctx, field, obj)
2467 case "locations":
2468 out.Values[i] = ec.___Directive_locations(ctx, field, obj)
2469 case "args":
2470 out.Values[i] = ec.___Directive_args(ctx, field, obj)
2471 default:
2472 panic("unknown field " + strconv.Quote(field.Name))
2473 }
2474 }
2475
2476 return out
2477}
2478
2479func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler {
2480 rctx := graphql.GetResolverContext(ctx)
2481 rctx.Object = "__Directive"
2482 rctx.Args = nil
2483 rctx.Field = field
2484 rctx.PushField(field.Alias)
2485 defer rctx.Pop()
2486 res := obj.Name()
2487 return graphql.MarshalString(res)
2488}
2489
2490func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler {
2491 rctx := graphql.GetResolverContext(ctx)
2492 rctx.Object = "__Directive"
2493 rctx.Args = nil
2494 rctx.Field = field
2495 rctx.PushField(field.Alias)
2496 defer rctx.Pop()
2497 res := obj.Description()
2498 if res == nil {
2499 return graphql.Null
2500 }
2501 return graphql.MarshalString(*res)
2502}
2503
2504func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler {
2505 rctx := graphql.GetResolverContext(ctx)
2506 rctx.Object = "__Directive"
2507 rctx.Args = nil
2508 rctx.Field = field
2509 rctx.PushField(field.Alias)
2510 defer rctx.Pop()
2511 res := obj.Locations()
2512 arr1 := graphql.Array{}
2513 for idx1 := range res {
2514 arr1 = append(arr1, func() graphql.Marshaler {
2515 rctx := graphql.GetResolverContext(ctx)
2516 rctx.PushIndex(idx1)
2517 defer rctx.Pop()
2518 return graphql.MarshalString(res[idx1])
2519 }())
2520 }
2521 return arr1
2522}
2523
2524func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler {
2525 rctx := graphql.GetResolverContext(ctx)
2526 rctx.Object = "__Directive"
2527 rctx.Args = nil
2528 rctx.Field = field
2529 rctx.PushField(field.Alias)
2530 defer rctx.Pop()
2531 res := obj.Args()
2532 arr1 := graphql.Array{}
2533 for idx1 := range res {
2534 arr1 = append(arr1, func() graphql.Marshaler {
2535 rctx := graphql.GetResolverContext(ctx)
2536 rctx.PushIndex(idx1)
2537 defer rctx.Pop()
2538 return ec.___InputValue(ctx, field.Selections, &res[idx1])
2539 }())
2540 }
2541 return arr1
2542}
2543
2544var __EnumValueImplementors = []string{"__EnumValue"}
2545
2546// nolint: gocyclo, errcheck, gas, goconst
2547func (ec *executionContext) ___EnumValue(ctx context.Context, sel []query.Selection, obj *introspection.EnumValue) graphql.Marshaler {
2548 fields := graphql.CollectFields(ec.Doc, sel, __EnumValueImplementors, ec.Variables)
2549
2550 out := graphql.NewOrderedMap(len(fields))
2551 for i, field := range fields {
2552 out.Keys[i] = field.Alias
2553
2554 switch field.Name {
2555 case "__typename":
2556 out.Values[i] = graphql.MarshalString("__EnumValue")
2557 case "name":
2558 out.Values[i] = ec.___EnumValue_name(ctx, field, obj)
2559 case "description":
2560 out.Values[i] = ec.___EnumValue_description(ctx, field, obj)
2561 case "isDeprecated":
2562 out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj)
2563 case "deprecationReason":
2564 out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj)
2565 default:
2566 panic("unknown field " + strconv.Quote(field.Name))
2567 }
2568 }
2569
2570 return out
2571}
2572
2573func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler {
2574 rctx := graphql.GetResolverContext(ctx)
2575 rctx.Object = "__EnumValue"
2576 rctx.Args = nil
2577 rctx.Field = field
2578 rctx.PushField(field.Alias)
2579 defer rctx.Pop()
2580 res := obj.Name()
2581 return graphql.MarshalString(res)
2582}
2583
2584func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler {
2585 rctx := graphql.GetResolverContext(ctx)
2586 rctx.Object = "__EnumValue"
2587 rctx.Args = nil
2588 rctx.Field = field
2589 rctx.PushField(field.Alias)
2590 defer rctx.Pop()
2591 res := obj.Description()
2592 if res == nil {
2593 return graphql.Null
2594 }
2595 return graphql.MarshalString(*res)
2596}
2597
2598func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler {
2599 rctx := graphql.GetResolverContext(ctx)
2600 rctx.Object = "__EnumValue"
2601 rctx.Args = nil
2602 rctx.Field = field
2603 rctx.PushField(field.Alias)
2604 defer rctx.Pop()
2605 res := obj.IsDeprecated()
2606 return graphql.MarshalBoolean(res)
2607}
2608
2609func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler {
2610 rctx := graphql.GetResolverContext(ctx)
2611 rctx.Object = "__EnumValue"
2612 rctx.Args = nil
2613 rctx.Field = field
2614 rctx.PushField(field.Alias)
2615 defer rctx.Pop()
2616 res := obj.DeprecationReason()
2617 if res == nil {
2618 return graphql.Null
2619 }
2620 return graphql.MarshalString(*res)
2621}
2622
2623var __FieldImplementors = []string{"__Field"}
2624
2625// nolint: gocyclo, errcheck, gas, goconst
2626func (ec *executionContext) ___Field(ctx context.Context, sel []query.Selection, obj *introspection.Field) graphql.Marshaler {
2627 fields := graphql.CollectFields(ec.Doc, sel, __FieldImplementors, ec.Variables)
2628
2629 out := graphql.NewOrderedMap(len(fields))
2630 for i, field := range fields {
2631 out.Keys[i] = field.Alias
2632
2633 switch field.Name {
2634 case "__typename":
2635 out.Values[i] = graphql.MarshalString("__Field")
2636 case "name":
2637 out.Values[i] = ec.___Field_name(ctx, field, obj)
2638 case "description":
2639 out.Values[i] = ec.___Field_description(ctx, field, obj)
2640 case "args":
2641 out.Values[i] = ec.___Field_args(ctx, field, obj)
2642 case "type":
2643 out.Values[i] = ec.___Field_type(ctx, field, obj)
2644 case "isDeprecated":
2645 out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj)
2646 case "deprecationReason":
2647 out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj)
2648 default:
2649 panic("unknown field " + strconv.Quote(field.Name))
2650 }
2651 }
2652
2653 return out
2654}
2655
2656func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {
2657 rctx := graphql.GetResolverContext(ctx)
2658 rctx.Object = "__Field"
2659 rctx.Args = nil
2660 rctx.Field = field
2661 rctx.PushField(field.Alias)
2662 defer rctx.Pop()
2663 res := obj.Name()
2664 return graphql.MarshalString(res)
2665}
2666
2667func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {
2668 rctx := graphql.GetResolverContext(ctx)
2669 rctx.Object = "__Field"
2670 rctx.Args = nil
2671 rctx.Field = field
2672 rctx.PushField(field.Alias)
2673 defer rctx.Pop()
2674 res := obj.Description()
2675 if res == nil {
2676 return graphql.Null
2677 }
2678 return graphql.MarshalString(*res)
2679}
2680
2681func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {
2682 rctx := graphql.GetResolverContext(ctx)
2683 rctx.Object = "__Field"
2684 rctx.Args = nil
2685 rctx.Field = field
2686 rctx.PushField(field.Alias)
2687 defer rctx.Pop()
2688 res := obj.Args()
2689 arr1 := graphql.Array{}
2690 for idx1 := range res {
2691 arr1 = append(arr1, func() graphql.Marshaler {
2692 rctx := graphql.GetResolverContext(ctx)
2693 rctx.PushIndex(idx1)
2694 defer rctx.Pop()
2695 return ec.___InputValue(ctx, field.Selections, &res[idx1])
2696 }())
2697 }
2698 return arr1
2699}
2700
2701func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {
2702 rctx := graphql.GetResolverContext(ctx)
2703 rctx.Object = "__Field"
2704 rctx.Args = nil
2705 rctx.Field = field
2706 rctx.PushField(field.Alias)
2707 defer rctx.Pop()
2708 res := obj.Type()
2709 return ec.___Type(ctx, field.Selections, &res)
2710}
2711
2712func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {
2713 rctx := graphql.GetResolverContext(ctx)
2714 rctx.Object = "__Field"
2715 rctx.Args = nil
2716 rctx.Field = field
2717 rctx.PushField(field.Alias)
2718 defer rctx.Pop()
2719 res := obj.IsDeprecated()
2720 return graphql.MarshalBoolean(res)
2721}
2722
2723func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {
2724 rctx := graphql.GetResolverContext(ctx)
2725 rctx.Object = "__Field"
2726 rctx.Args = nil
2727 rctx.Field = field
2728 rctx.PushField(field.Alias)
2729 defer rctx.Pop()
2730 res := obj.DeprecationReason()
2731 if res == nil {
2732 return graphql.Null
2733 }
2734 return graphql.MarshalString(*res)
2735}
2736
2737var __InputValueImplementors = []string{"__InputValue"}
2738
2739// nolint: gocyclo, errcheck, gas, goconst
2740func (ec *executionContext) ___InputValue(ctx context.Context, sel []query.Selection, obj *introspection.InputValue) graphql.Marshaler {
2741 fields := graphql.CollectFields(ec.Doc, sel, __InputValueImplementors, ec.Variables)
2742
2743 out := graphql.NewOrderedMap(len(fields))
2744 for i, field := range fields {
2745 out.Keys[i] = field.Alias
2746
2747 switch field.Name {
2748 case "__typename":
2749 out.Values[i] = graphql.MarshalString("__InputValue")
2750 case "name":
2751 out.Values[i] = ec.___InputValue_name(ctx, field, obj)
2752 case "description":
2753 out.Values[i] = ec.___InputValue_description(ctx, field, obj)
2754 case "type":
2755 out.Values[i] = ec.___InputValue_type(ctx, field, obj)
2756 case "defaultValue":
2757 out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj)
2758 default:
2759 panic("unknown field " + strconv.Quote(field.Name))
2760 }
2761 }
2762
2763 return out
2764}
2765
2766func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler {
2767 rctx := graphql.GetResolverContext(ctx)
2768 rctx.Object = "__InputValue"
2769 rctx.Args = nil
2770 rctx.Field = field
2771 rctx.PushField(field.Alias)
2772 defer rctx.Pop()
2773 res := obj.Name()
2774 return graphql.MarshalString(res)
2775}
2776
2777func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler {
2778 rctx := graphql.GetResolverContext(ctx)
2779 rctx.Object = "__InputValue"
2780 rctx.Args = nil
2781 rctx.Field = field
2782 rctx.PushField(field.Alias)
2783 defer rctx.Pop()
2784 res := obj.Description()
2785 if res == nil {
2786 return graphql.Null
2787 }
2788 return graphql.MarshalString(*res)
2789}
2790
2791func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler {
2792 rctx := graphql.GetResolverContext(ctx)
2793 rctx.Object = "__InputValue"
2794 rctx.Args = nil
2795 rctx.Field = field
2796 rctx.PushField(field.Alias)
2797 defer rctx.Pop()
2798 res := obj.Type()
2799 return ec.___Type(ctx, field.Selections, &res)
2800}
2801
2802func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler {
2803 rctx := graphql.GetResolverContext(ctx)
2804 rctx.Object = "__InputValue"
2805 rctx.Args = nil
2806 rctx.Field = field
2807 rctx.PushField(field.Alias)
2808 defer rctx.Pop()
2809 res := obj.DefaultValue()
2810 if res == nil {
2811 return graphql.Null
2812 }
2813 return graphql.MarshalString(*res)
2814}
2815
2816var __SchemaImplementors = []string{"__Schema"}
2817
2818// nolint: gocyclo, errcheck, gas, goconst
2819func (ec *executionContext) ___Schema(ctx context.Context, sel []query.Selection, obj *introspection.Schema) graphql.Marshaler {
2820 fields := graphql.CollectFields(ec.Doc, sel, __SchemaImplementors, ec.Variables)
2821
2822 out := graphql.NewOrderedMap(len(fields))
2823 for i, field := range fields {
2824 out.Keys[i] = field.Alias
2825
2826 switch field.Name {
2827 case "__typename":
2828 out.Values[i] = graphql.MarshalString("__Schema")
2829 case "types":
2830 out.Values[i] = ec.___Schema_types(ctx, field, obj)
2831 case "queryType":
2832 out.Values[i] = ec.___Schema_queryType(ctx, field, obj)
2833 case "mutationType":
2834 out.Values[i] = ec.___Schema_mutationType(ctx, field, obj)
2835 case "subscriptionType":
2836 out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj)
2837 case "directives":
2838 out.Values[i] = ec.___Schema_directives(ctx, field, obj)
2839 default:
2840 panic("unknown field " + strconv.Quote(field.Name))
2841 }
2842 }
2843
2844 return out
2845}
2846
2847func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler {
2848 rctx := graphql.GetResolverContext(ctx)
2849 rctx.Object = "__Schema"
2850 rctx.Args = nil
2851 rctx.Field = field
2852 rctx.PushField(field.Alias)
2853 defer rctx.Pop()
2854 res := obj.Types()
2855 arr1 := graphql.Array{}
2856 for idx1 := range res {
2857 arr1 = append(arr1, func() graphql.Marshaler {
2858 rctx := graphql.GetResolverContext(ctx)
2859 rctx.PushIndex(idx1)
2860 defer rctx.Pop()
2861 return ec.___Type(ctx, field.Selections, &res[idx1])
2862 }())
2863 }
2864 return arr1
2865}
2866
2867func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler {
2868 rctx := graphql.GetResolverContext(ctx)
2869 rctx.Object = "__Schema"
2870 rctx.Args = nil
2871 rctx.Field = field
2872 rctx.PushField(field.Alias)
2873 defer rctx.Pop()
2874 res := obj.QueryType()
2875 return ec.___Type(ctx, field.Selections, &res)
2876}
2877
2878func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler {
2879 rctx := graphql.GetResolverContext(ctx)
2880 rctx.Object = "__Schema"
2881 rctx.Args = nil
2882 rctx.Field = field
2883 rctx.PushField(field.Alias)
2884 defer rctx.Pop()
2885 res := obj.MutationType()
2886 if res == nil {
2887 return graphql.Null
2888 }
2889 return ec.___Type(ctx, field.Selections, res)
2890}
2891
2892func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler {
2893 rctx := graphql.GetResolverContext(ctx)
2894 rctx.Object = "__Schema"
2895 rctx.Args = nil
2896 rctx.Field = field
2897 rctx.PushField(field.Alias)
2898 defer rctx.Pop()
2899 res := obj.SubscriptionType()
2900 if res == nil {
2901 return graphql.Null
2902 }
2903 return ec.___Type(ctx, field.Selections, res)
2904}
2905
2906func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler {
2907 rctx := graphql.GetResolverContext(ctx)
2908 rctx.Object = "__Schema"
2909 rctx.Args = nil
2910 rctx.Field = field
2911 rctx.PushField(field.Alias)
2912 defer rctx.Pop()
2913 res := obj.Directives()
2914 arr1 := graphql.Array{}
2915 for idx1 := range res {
2916 arr1 = append(arr1, func() graphql.Marshaler {
2917 rctx := graphql.GetResolverContext(ctx)
2918 rctx.PushIndex(idx1)
2919 defer rctx.Pop()
2920 return ec.___Directive(ctx, field.Selections, &res[idx1])
2921 }())
2922 }
2923 return arr1
2924}
2925
2926var __TypeImplementors = []string{"__Type"}
2927
2928// nolint: gocyclo, errcheck, gas, goconst
2929func (ec *executionContext) ___Type(ctx context.Context, sel []query.Selection, obj *introspection.Type) graphql.Marshaler {
2930 fields := graphql.CollectFields(ec.Doc, sel, __TypeImplementors, ec.Variables)
2931
2932 out := graphql.NewOrderedMap(len(fields))
2933 for i, field := range fields {
2934 out.Keys[i] = field.Alias
2935
2936 switch field.Name {
2937 case "__typename":
2938 out.Values[i] = graphql.MarshalString("__Type")
2939 case "kind":
2940 out.Values[i] = ec.___Type_kind(ctx, field, obj)
2941 case "name":
2942 out.Values[i] = ec.___Type_name(ctx, field, obj)
2943 case "description":
2944 out.Values[i] = ec.___Type_description(ctx, field, obj)
2945 case "fields":
2946 out.Values[i] = ec.___Type_fields(ctx, field, obj)
2947 case "interfaces":
2948 out.Values[i] = ec.___Type_interfaces(ctx, field, obj)
2949 case "possibleTypes":
2950 out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj)
2951 case "enumValues":
2952 out.Values[i] = ec.___Type_enumValues(ctx, field, obj)
2953 case "inputFields":
2954 out.Values[i] = ec.___Type_inputFields(ctx, field, obj)
2955 case "ofType":
2956 out.Values[i] = ec.___Type_ofType(ctx, field, obj)
2957 default:
2958 panic("unknown field " + strconv.Quote(field.Name))
2959 }
2960 }
2961
2962 return out
2963}
2964
2965func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
2966 rctx := graphql.GetResolverContext(ctx)
2967 rctx.Object = "__Type"
2968 rctx.Args = nil
2969 rctx.Field = field
2970 rctx.PushField(field.Alias)
2971 defer rctx.Pop()
2972 res := obj.Kind()
2973 return graphql.MarshalString(res)
2974}
2975
2976func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
2977 rctx := graphql.GetResolverContext(ctx)
2978 rctx.Object = "__Type"
2979 rctx.Args = nil
2980 rctx.Field = field
2981 rctx.PushField(field.Alias)
2982 defer rctx.Pop()
2983 res := obj.Name()
2984 if res == nil {
2985 return graphql.Null
2986 }
2987 return graphql.MarshalString(*res)
2988}
2989
2990func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
2991 rctx := graphql.GetResolverContext(ctx)
2992 rctx.Object = "__Type"
2993 rctx.Args = nil
2994 rctx.Field = field
2995 rctx.PushField(field.Alias)
2996 defer rctx.Pop()
2997 res := obj.Description()
2998 if res == nil {
2999 return graphql.Null
3000 }
3001 return graphql.MarshalString(*res)
3002}
3003
3004func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
3005 args := map[string]interface{}{}
3006 var arg0 bool
3007 if tmp, ok := field.Args["includeDeprecated"]; ok {
3008 var err error
3009 arg0, err = graphql.UnmarshalBoolean(tmp)
3010 if err != nil {
3011 ec.Error(ctx, err)
3012 return graphql.Null
3013 }
3014 }
3015 args["includeDeprecated"] = arg0
3016 rctx := graphql.GetResolverContext(ctx)
3017 rctx.Object = "__Type"
3018 rctx.Args = args
3019 rctx.Field = field
3020 rctx.PushField(field.Alias)
3021 defer rctx.Pop()
3022 res := obj.Fields(args["includeDeprecated"].(bool))
3023 arr1 := graphql.Array{}
3024 for idx1 := range res {
3025 arr1 = append(arr1, func() graphql.Marshaler {
3026 rctx := graphql.GetResolverContext(ctx)
3027 rctx.PushIndex(idx1)
3028 defer rctx.Pop()
3029 return ec.___Field(ctx, field.Selections, &res[idx1])
3030 }())
3031 }
3032 return arr1
3033}
3034
3035func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
3036 rctx := graphql.GetResolverContext(ctx)
3037 rctx.Object = "__Type"
3038 rctx.Args = nil
3039 rctx.Field = field
3040 rctx.PushField(field.Alias)
3041 defer rctx.Pop()
3042 res := obj.Interfaces()
3043 arr1 := graphql.Array{}
3044 for idx1 := range res {
3045 arr1 = append(arr1, func() graphql.Marshaler {
3046 rctx := graphql.GetResolverContext(ctx)
3047 rctx.PushIndex(idx1)
3048 defer rctx.Pop()
3049 return ec.___Type(ctx, field.Selections, &res[idx1])
3050 }())
3051 }
3052 return arr1
3053}
3054
3055func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
3056 rctx := graphql.GetResolverContext(ctx)
3057 rctx.Object = "__Type"
3058 rctx.Args = nil
3059 rctx.Field = field
3060 rctx.PushField(field.Alias)
3061 defer rctx.Pop()
3062 res := obj.PossibleTypes()
3063 arr1 := graphql.Array{}
3064 for idx1 := range res {
3065 arr1 = append(arr1, func() graphql.Marshaler {
3066 rctx := graphql.GetResolverContext(ctx)
3067 rctx.PushIndex(idx1)
3068 defer rctx.Pop()
3069 return ec.___Type(ctx, field.Selections, &res[idx1])
3070 }())
3071 }
3072 return arr1
3073}
3074
3075func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
3076 args := map[string]interface{}{}
3077 var arg0 bool
3078 if tmp, ok := field.Args["includeDeprecated"]; ok {
3079 var err error
3080 arg0, err = graphql.UnmarshalBoolean(tmp)
3081 if err != nil {
3082 ec.Error(ctx, err)
3083 return graphql.Null
3084 }
3085 }
3086 args["includeDeprecated"] = arg0
3087 rctx := graphql.GetResolverContext(ctx)
3088 rctx.Object = "__Type"
3089 rctx.Args = args
3090 rctx.Field = field
3091 rctx.PushField(field.Alias)
3092 defer rctx.Pop()
3093 res := obj.EnumValues(args["includeDeprecated"].(bool))
3094 arr1 := graphql.Array{}
3095 for idx1 := range res {
3096 arr1 = append(arr1, func() graphql.Marshaler {
3097 rctx := graphql.GetResolverContext(ctx)
3098 rctx.PushIndex(idx1)
3099 defer rctx.Pop()
3100 return ec.___EnumValue(ctx, field.Selections, &res[idx1])
3101 }())
3102 }
3103 return arr1
3104}
3105
3106func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
3107 rctx := graphql.GetResolverContext(ctx)
3108 rctx.Object = "__Type"
3109 rctx.Args = nil
3110 rctx.Field = field
3111 rctx.PushField(field.Alias)
3112 defer rctx.Pop()
3113 res := obj.InputFields()
3114 arr1 := graphql.Array{}
3115 for idx1 := range res {
3116 arr1 = append(arr1, func() graphql.Marshaler {
3117 rctx := graphql.GetResolverContext(ctx)
3118 rctx.PushIndex(idx1)
3119 defer rctx.Pop()
3120 return ec.___InputValue(ctx, field.Selections, &res[idx1])
3121 }())
3122 }
3123 return arr1
3124}
3125
3126func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
3127 rctx := graphql.GetResolverContext(ctx)
3128 rctx.Object = "__Type"
3129 rctx.Args = nil
3130 rctx.Field = field
3131 rctx.PushField(field.Alias)
3132 defer rctx.Pop()
3133 res := obj.OfType()
3134 if res == nil {
3135 return graphql.Null
3136 }
3137 return ec.___Type(ctx, field.Selections, res)
3138}
3139
3140func (ec *executionContext) _Authored(ctx context.Context, sel []query.Selection, obj *models.Authored) graphql.Marshaler {
3141 switch obj := (*obj).(type) {
3142 case nil:
3143 return graphql.Null
3144 case bug.Comment:
3145 return ec._Comment(ctx, sel, &obj)
3146 case *bug.Comment:
3147 return ec._Comment(ctx, sel, obj)
3148 case operations.CreateOperation:
3149 return ec._CreateOperation(ctx, sel, &obj)
3150 case *operations.CreateOperation:
3151 return ec._CreateOperation(ctx, sel, obj)
3152 case operations.SetTitleOperation:
3153 return ec._SetTitleOperation(ctx, sel, &obj)
3154 case *operations.SetTitleOperation:
3155 return ec._SetTitleOperation(ctx, sel, obj)
3156 case operations.AddCommentOperation:
3157 return ec._AddCommentOperation(ctx, sel, &obj)
3158 case *operations.AddCommentOperation:
3159 return ec._AddCommentOperation(ctx, sel, obj)
3160 case operations.SetStatusOperation:
3161 return ec._SetStatusOperation(ctx, sel, &obj)
3162 case *operations.SetStatusOperation:
3163 return ec._SetStatusOperation(ctx, sel, obj)
3164 case operations.LabelChangeOperation:
3165 return ec._LabelChangeOperation(ctx, sel, &obj)
3166 case *operations.LabelChangeOperation:
3167 return ec._LabelChangeOperation(ctx, sel, obj)
3168 default:
3169 panic(fmt.Errorf("unexpected type %T", obj))
3170 }
3171}
3172
3173func (ec *executionContext) _Operation(ctx context.Context, sel []query.Selection, obj *bug.Operation) graphql.Marshaler {
3174 switch obj := (*obj).(type) {
3175 case nil:
3176 return graphql.Null
3177 case operations.CreateOperation:
3178 return ec._CreateOperation(ctx, sel, &obj)
3179 case *operations.CreateOperation:
3180 return ec._CreateOperation(ctx, sel, obj)
3181 case operations.SetTitleOperation:
3182 return ec._SetTitleOperation(ctx, sel, &obj)
3183 case *operations.SetTitleOperation:
3184 return ec._SetTitleOperation(ctx, sel, obj)
3185 case operations.AddCommentOperation:
3186 return ec._AddCommentOperation(ctx, sel, &obj)
3187 case *operations.AddCommentOperation:
3188 return ec._AddCommentOperation(ctx, sel, obj)
3189 case operations.SetStatusOperation:
3190 return ec._SetStatusOperation(ctx, sel, &obj)
3191 case *operations.SetStatusOperation:
3192 return ec._SetStatusOperation(ctx, sel, obj)
3193 case operations.LabelChangeOperation:
3194 return ec._LabelChangeOperation(ctx, sel, &obj)
3195 case *operations.LabelChangeOperation:
3196 return ec._LabelChangeOperation(ctx, sel, obj)
3197 default:
3198 panic(fmt.Errorf("unexpected type %T", obj))
3199 }
3200}
3201
3202func (ec *executionContext) introspectSchema() *introspection.Schema {
3203 return introspection.WrapSchema(parsedSchema)
3204}
3205
3206func (ec *executionContext) introspectType(name string) *introspection.Type {
3207 t := parsedSchema.Resolve(name)
3208 if t == nil {
3209 return nil
3210 }
3211 return introspection.WrapType(t)
3212}
3213
3214var parsedSchema = schema.MustParse(`scalar Time
3215scalar Label
3216scalar Hash
3217
3218# Information about pagination in a connection.
3219type PageInfo {
3220 # When paginating forwards, are there more items?
3221 hasNextPage: Boolean!
3222 # When paginating backwards, are there more items?
3223 hasPreviousPage: Boolean!
3224 # When paginating backwards, the cursor to continue.
3225# startCursor: String
3226 # When paginating forwards, the cursor to continue.
3227# endCursor: String
3228}
3229
3230# Represents an person in a git object.
3231type Person {
3232 # The email of the person.
3233 email: String
3234
3235 # The name of the person.
3236 name: String
3237}
3238
3239type CommentConnection {
3240 edges: [CommentEdge!]!
3241 nodes: [Comment!]!
3242 pageInfo: PageInfo!
3243 totalCount: Int!
3244}
3245
3246type CommentEdge {
3247 cursor: String!
3248 node: Comment!
3249}
3250
3251# Represents a comment on a bug.
3252type Comment implements Authored {
3253 # The author of this comment.
3254 author: Person!
3255
3256 # The message of this comment.
3257 message: String!
3258
3259 # All media's hash referenced in this comment
3260 files: [Hash!]!
3261}
3262
3263enum Status {
3264 OPEN
3265 CLOSED
3266}
3267
3268# An object that has an author.
3269interface Authored {
3270 # The author of this object.
3271 author: Person!
3272}
3273
3274type OperationConnection {
3275 edges: [OperationEdge!]!
3276 nodes: [Operation!]!
3277 pageInfo: PageInfo!
3278 totalCount: Int!
3279}
3280
3281type OperationEdge {
3282 cursor: String!
3283 node: Operation!
3284}
3285
3286# An operation applied to a bug.
3287interface Operation {
3288 # The operations author.
3289 author: Person!
3290 # The datetime when this operation was issued.
3291 date: Time!
3292}
3293
3294type CreateOperation implements Operation, Authored {
3295 author: Person!
3296 date: Time!
3297
3298 title: String!
3299 message: String!
3300 files: [Hash!]!
3301}
3302
3303type SetTitleOperation implements Operation, Authored {
3304 author: Person!
3305 date: Time!
3306
3307 title: String!
3308}
3309
3310type AddCommentOperation implements Operation, Authored {
3311 author: Person!
3312 date: Time!
3313
3314 message: String!
3315 files: [Hash!]!
3316}
3317
3318type SetStatusOperation implements Operation, Authored {
3319 author: Person!
3320 date: Time!
3321
3322 status: Status!
3323}
3324
3325type LabelChangeOperation implements Operation, Authored {
3326 author: Person!
3327 date: Time!
3328
3329 added: [Label!]!
3330 removed: [Label!]!
3331}
3332
3333# The connection type for Bug.
3334type BugConnection {
3335 # A list of edges.
3336 edges: [BugEdge!]!
3337 nodes: [Bug!]!
3338 # Information to aid in pagination.
3339 pageInfo: PageInfo!
3340 # Identifies the total count of items in the connection.
3341 totalCount: Int!
3342}
3343
3344# An edge in a connection.
3345type BugEdge {
3346 # A cursor for use in pagination.
3347 cursor: String!
3348 # The item at the end of the edge.
3349 node: Bug!
3350}
3351
3352type Bug {
3353 id: String!
3354 humanId: String!
3355 status: Status!
3356 title: String!
3357 labels: [Label!]!
3358 author: Person!
3359 createdAt: Time!
3360 lastEdit: Time!
3361
3362 comments(
3363 # Returns the elements in the list that come after the specified cursor.
3364 after: String
3365 # Returns the elements in the list that come before the specified cursor.
3366 before: String
3367 # Returns the first _n_ elements from the list.
3368 first: Int
3369 # Returns the last _n_ elements from the list.
3370 last: Int
3371 ): CommentConnection!
3372
3373 operations(
3374 # Returns the elements in the list that come after the specified cursor.
3375 after: String
3376 # Returns the elements in the list that come before the specified cursor.
3377 before: String
3378 # Returns the first _n_ elements from the list.
3379 first: Int
3380 # Returns the last _n_ elements from the list.
3381 last: Int
3382 ): OperationConnection!
3383}
3384
3385type Repository {
3386 allBugs(
3387 # Returns the elements in the list that come after the specified cursor.
3388 after: String
3389 # Returns the elements in the list that come before the specified cursor.
3390 before: String
3391 # Returns the first _n_ elements from the list.
3392 first: Int
3393 # Returns the last _n_ elements from the list.
3394 last: Int
3395 ): BugConnection!
3396 bug(prefix: String!): Bug
3397}
3398
3399type Query {
3400 defaultRepository: Repository
3401 repository(id: String!): Repository
3402}
3403
3404type Mutation {
3405 newBug(repoRef: String, title: String!, message: String!, files: [Hash!]): Bug!
3406
3407 addComment(repoRef: String, prefix: String!, message: String!, files: [Hash!]): Bug!
3408 changeLabels(repoRef: String, prefix: String!, added: [String!], removed: [String!]): Bug!
3409 open(repoRef: String, prefix: String!): Bug!
3410 close(repoRef: String, prefix: String!): Bug!
3411 setTitle(repoRef: String, prefix: String!, title: String!): Bug!
3412
3413 commit(repoRef: String, prefix: String!): Bug!
3414}
3415`)