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 case "startCursor":
1888 out.Values[i] = ec._PageInfo_startCursor(ctx, field, obj)
1889 case "endCursor":
1890 out.Values[i] = ec._PageInfo_endCursor(ctx, field, obj)
1891 default:
1892 panic("unknown field " + strconv.Quote(field.Name))
1893 }
1894 }
1895
1896 return out
1897}
1898
1899func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *models.PageInfo) graphql.Marshaler {
1900 rctx := graphql.GetResolverContext(ctx)
1901 rctx.Object = "PageInfo"
1902 rctx.Args = nil
1903 rctx.Field = field
1904 rctx.PushField(field.Alias)
1905 defer rctx.Pop()
1906 res := obj.HasNextPage
1907 return graphql.MarshalBoolean(res)
1908}
1909
1910func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField, obj *models.PageInfo) graphql.Marshaler {
1911 rctx := graphql.GetResolverContext(ctx)
1912 rctx.Object = "PageInfo"
1913 rctx.Args = nil
1914 rctx.Field = field
1915 rctx.PushField(field.Alias)
1916 defer rctx.Pop()
1917 res := obj.HasPreviousPage
1918 return graphql.MarshalBoolean(res)
1919}
1920
1921func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *models.PageInfo) graphql.Marshaler {
1922 rctx := graphql.GetResolverContext(ctx)
1923 rctx.Object = "PageInfo"
1924 rctx.Args = nil
1925 rctx.Field = field
1926 rctx.PushField(field.Alias)
1927 defer rctx.Pop()
1928 res := obj.StartCursor
1929 return graphql.MarshalString(res)
1930}
1931
1932func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *models.PageInfo) graphql.Marshaler {
1933 rctx := graphql.GetResolverContext(ctx)
1934 rctx.Object = "PageInfo"
1935 rctx.Args = nil
1936 rctx.Field = field
1937 rctx.PushField(field.Alias)
1938 defer rctx.Pop()
1939 res := obj.EndCursor
1940 return graphql.MarshalString(res)
1941}
1942
1943var personImplementors = []string{"Person"}
1944
1945// nolint: gocyclo, errcheck, gas, goconst
1946func (ec *executionContext) _Person(ctx context.Context, sel []query.Selection, obj *bug.Person) graphql.Marshaler {
1947 fields := graphql.CollectFields(ec.Doc, sel, personImplementors, ec.Variables)
1948
1949 out := graphql.NewOrderedMap(len(fields))
1950 for i, field := range fields {
1951 out.Keys[i] = field.Alias
1952
1953 switch field.Name {
1954 case "__typename":
1955 out.Values[i] = graphql.MarshalString("Person")
1956 case "email":
1957 out.Values[i] = ec._Person_email(ctx, field, obj)
1958 case "name":
1959 out.Values[i] = ec._Person_name(ctx, field, obj)
1960 default:
1961 panic("unknown field " + strconv.Quote(field.Name))
1962 }
1963 }
1964
1965 return out
1966}
1967
1968func (ec *executionContext) _Person_email(ctx context.Context, field graphql.CollectedField, obj *bug.Person) graphql.Marshaler {
1969 rctx := graphql.GetResolverContext(ctx)
1970 rctx.Object = "Person"
1971 rctx.Args = nil
1972 rctx.Field = field
1973 rctx.PushField(field.Alias)
1974 defer rctx.Pop()
1975 res := obj.Email
1976 return graphql.MarshalString(res)
1977}
1978
1979func (ec *executionContext) _Person_name(ctx context.Context, field graphql.CollectedField, obj *bug.Person) graphql.Marshaler {
1980 rctx := graphql.GetResolverContext(ctx)
1981 rctx.Object = "Person"
1982 rctx.Args = nil
1983 rctx.Field = field
1984 rctx.PushField(field.Alias)
1985 defer rctx.Pop()
1986 res := obj.Name
1987 return graphql.MarshalString(res)
1988}
1989
1990var queryImplementors = []string{"Query"}
1991
1992// nolint: gocyclo, errcheck, gas, goconst
1993func (ec *executionContext) _Query(ctx context.Context, sel []query.Selection) graphql.Marshaler {
1994 fields := graphql.CollectFields(ec.Doc, sel, queryImplementors, ec.Variables)
1995
1996 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{
1997 Object: "Query",
1998 })
1999
2000 out := graphql.NewOrderedMap(len(fields))
2001 for i, field := range fields {
2002 out.Keys[i] = field.Alias
2003
2004 switch field.Name {
2005 case "__typename":
2006 out.Values[i] = graphql.MarshalString("Query")
2007 case "defaultRepository":
2008 out.Values[i] = ec._Query_defaultRepository(ctx, field)
2009 case "repository":
2010 out.Values[i] = ec._Query_repository(ctx, field)
2011 case "__schema":
2012 out.Values[i] = ec._Query___schema(ctx, field)
2013 case "__type":
2014 out.Values[i] = ec._Query___type(ctx, field)
2015 default:
2016 panic("unknown field " + strconv.Quote(field.Name))
2017 }
2018 }
2019
2020 return out
2021}
2022
2023func (ec *executionContext) _Query_defaultRepository(ctx context.Context, field graphql.CollectedField) graphql.Marshaler {
2024 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{
2025 Object: "Query",
2026 Args: nil,
2027 Field: field,
2028 })
2029 return graphql.Defer(func() (ret graphql.Marshaler) {
2030 defer func() {
2031 if r := recover(); r != nil {
2032 userErr := ec.Recover(ctx, r)
2033 ec.Error(ctx, userErr)
2034 ret = graphql.Null
2035 }
2036 }()
2037
2038 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
2039 return ec.resolvers.Query_defaultRepository(ctx)
2040 })
2041 if err != nil {
2042 ec.Error(ctx, err)
2043 return graphql.Null
2044 }
2045 if resTmp == nil {
2046 return graphql.Null
2047 }
2048 res := resTmp.(*models.Repository)
2049 if res == nil {
2050 return graphql.Null
2051 }
2052 return ec._Repository(ctx, field.Selections, res)
2053 })
2054}
2055
2056func (ec *executionContext) _Query_repository(ctx context.Context, field graphql.CollectedField) graphql.Marshaler {
2057 args := map[string]interface{}{}
2058 var arg0 string
2059 if tmp, ok := field.Args["id"]; ok {
2060 var err error
2061 arg0, err = graphql.UnmarshalString(tmp)
2062 if err != nil {
2063 ec.Error(ctx, err)
2064 return graphql.Null
2065 }
2066 }
2067 args["id"] = arg0
2068 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{
2069 Object: "Query",
2070 Args: args,
2071 Field: field,
2072 })
2073 return graphql.Defer(func() (ret graphql.Marshaler) {
2074 defer func() {
2075 if r := recover(); r != nil {
2076 userErr := ec.Recover(ctx, r)
2077 ec.Error(ctx, userErr)
2078 ret = graphql.Null
2079 }
2080 }()
2081
2082 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
2083 return ec.resolvers.Query_repository(ctx, args["id"].(string))
2084 })
2085 if err != nil {
2086 ec.Error(ctx, err)
2087 return graphql.Null
2088 }
2089 if resTmp == nil {
2090 return graphql.Null
2091 }
2092 res := resTmp.(*models.Repository)
2093 if res == nil {
2094 return graphql.Null
2095 }
2096 return ec._Repository(ctx, field.Selections, res)
2097 })
2098}
2099
2100func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler {
2101 rctx := graphql.GetResolverContext(ctx)
2102 rctx.Object = "Query"
2103 rctx.Args = nil
2104 rctx.Field = field
2105 rctx.PushField(field.Alias)
2106 defer rctx.Pop()
2107 res := ec.introspectSchema()
2108 if res == nil {
2109 return graphql.Null
2110 }
2111 return ec.___Schema(ctx, field.Selections, res)
2112}
2113
2114func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler {
2115 args := map[string]interface{}{}
2116 var arg0 string
2117 if tmp, ok := field.Args["name"]; ok {
2118 var err error
2119 arg0, err = graphql.UnmarshalString(tmp)
2120 if err != nil {
2121 ec.Error(ctx, err)
2122 return graphql.Null
2123 }
2124 }
2125 args["name"] = arg0
2126 rctx := graphql.GetResolverContext(ctx)
2127 rctx.Object = "Query"
2128 rctx.Args = args
2129 rctx.Field = field
2130 rctx.PushField(field.Alias)
2131 defer rctx.Pop()
2132 res := ec.introspectType(args["name"].(string))
2133 if res == nil {
2134 return graphql.Null
2135 }
2136 return ec.___Type(ctx, field.Selections, res)
2137}
2138
2139var repositoryImplementors = []string{"Repository"}
2140
2141// nolint: gocyclo, errcheck, gas, goconst
2142func (ec *executionContext) _Repository(ctx context.Context, sel []query.Selection, obj *models.Repository) graphql.Marshaler {
2143 fields := graphql.CollectFields(ec.Doc, sel, repositoryImplementors, ec.Variables)
2144
2145 out := graphql.NewOrderedMap(len(fields))
2146 for i, field := range fields {
2147 out.Keys[i] = field.Alias
2148
2149 switch field.Name {
2150 case "__typename":
2151 out.Values[i] = graphql.MarshalString("Repository")
2152 case "allBugs":
2153 out.Values[i] = ec._Repository_allBugs(ctx, field, obj)
2154 case "bug":
2155 out.Values[i] = ec._Repository_bug(ctx, field, obj)
2156 default:
2157 panic("unknown field " + strconv.Quote(field.Name))
2158 }
2159 }
2160
2161 return out
2162}
2163
2164func (ec *executionContext) _Repository_allBugs(ctx context.Context, field graphql.CollectedField, obj *models.Repository) graphql.Marshaler {
2165 args := map[string]interface{}{}
2166 var arg0 *string
2167 if tmp, ok := field.Args["after"]; ok {
2168 var err error
2169 var ptr1 string
2170 if tmp != nil {
2171 ptr1, err = graphql.UnmarshalString(tmp)
2172 arg0 = &ptr1
2173 }
2174
2175 if err != nil {
2176 ec.Error(ctx, err)
2177 return graphql.Null
2178 }
2179 }
2180 args["after"] = arg0
2181 var arg1 *string
2182 if tmp, ok := field.Args["before"]; ok {
2183 var err error
2184 var ptr1 string
2185 if tmp != nil {
2186 ptr1, err = graphql.UnmarshalString(tmp)
2187 arg1 = &ptr1
2188 }
2189
2190 if err != nil {
2191 ec.Error(ctx, err)
2192 return graphql.Null
2193 }
2194 }
2195 args["before"] = arg1
2196 var arg2 *int
2197 if tmp, ok := field.Args["first"]; ok {
2198 var err error
2199 var ptr1 int
2200 if tmp != nil {
2201 ptr1, err = graphql.UnmarshalInt(tmp)
2202 arg2 = &ptr1
2203 }
2204
2205 if err != nil {
2206 ec.Error(ctx, err)
2207 return graphql.Null
2208 }
2209 }
2210 args["first"] = arg2
2211 var arg3 *int
2212 if tmp, ok := field.Args["last"]; ok {
2213 var err error
2214 var ptr1 int
2215 if tmp != nil {
2216 ptr1, err = graphql.UnmarshalInt(tmp)
2217 arg3 = &ptr1
2218 }
2219
2220 if err != nil {
2221 ec.Error(ctx, err)
2222 return graphql.Null
2223 }
2224 }
2225 args["last"] = arg3
2226 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{
2227 Object: "Repository",
2228 Args: args,
2229 Field: field,
2230 })
2231 return graphql.Defer(func() (ret graphql.Marshaler) {
2232 defer func() {
2233 if r := recover(); r != nil {
2234 userErr := ec.Recover(ctx, r)
2235 ec.Error(ctx, userErr)
2236 ret = graphql.Null
2237 }
2238 }()
2239
2240 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
2241 return ec.resolvers.Repository_allBugs(ctx, obj, args["after"].(*string), args["before"].(*string), args["first"].(*int), args["last"].(*int))
2242 })
2243 if err != nil {
2244 ec.Error(ctx, err)
2245 return graphql.Null
2246 }
2247 if resTmp == nil {
2248 return graphql.Null
2249 }
2250 res := resTmp.(models.BugConnection)
2251 return ec._BugConnection(ctx, field.Selections, &res)
2252 })
2253}
2254
2255func (ec *executionContext) _Repository_bug(ctx context.Context, field graphql.CollectedField, obj *models.Repository) graphql.Marshaler {
2256 args := map[string]interface{}{}
2257 var arg0 string
2258 if tmp, ok := field.Args["prefix"]; ok {
2259 var err error
2260 arg0, err = graphql.UnmarshalString(tmp)
2261 if err != nil {
2262 ec.Error(ctx, err)
2263 return graphql.Null
2264 }
2265 }
2266 args["prefix"] = arg0
2267 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{
2268 Object: "Repository",
2269 Args: args,
2270 Field: field,
2271 })
2272 return graphql.Defer(func() (ret graphql.Marshaler) {
2273 defer func() {
2274 if r := recover(); r != nil {
2275 userErr := ec.Recover(ctx, r)
2276 ec.Error(ctx, userErr)
2277 ret = graphql.Null
2278 }
2279 }()
2280
2281 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
2282 return ec.resolvers.Repository_bug(ctx, obj, args["prefix"].(string))
2283 })
2284 if err != nil {
2285 ec.Error(ctx, err)
2286 return graphql.Null
2287 }
2288 if resTmp == nil {
2289 return graphql.Null
2290 }
2291 res := resTmp.(*bug.Snapshot)
2292 if res == nil {
2293 return graphql.Null
2294 }
2295 return ec._Bug(ctx, field.Selections, res)
2296 })
2297}
2298
2299var setStatusOperationImplementors = []string{"SetStatusOperation", "Operation", "Authored"}
2300
2301// nolint: gocyclo, errcheck, gas, goconst
2302func (ec *executionContext) _SetStatusOperation(ctx context.Context, sel []query.Selection, obj *operations.SetStatusOperation) graphql.Marshaler {
2303 fields := graphql.CollectFields(ec.Doc, sel, setStatusOperationImplementors, ec.Variables)
2304
2305 out := graphql.NewOrderedMap(len(fields))
2306 for i, field := range fields {
2307 out.Keys[i] = field.Alias
2308
2309 switch field.Name {
2310 case "__typename":
2311 out.Values[i] = graphql.MarshalString("SetStatusOperation")
2312 case "author":
2313 out.Values[i] = ec._SetStatusOperation_author(ctx, field, obj)
2314 case "date":
2315 out.Values[i] = ec._SetStatusOperation_date(ctx, field, obj)
2316 case "status":
2317 out.Values[i] = ec._SetStatusOperation_status(ctx, field, obj)
2318 default:
2319 panic("unknown field " + strconv.Quote(field.Name))
2320 }
2321 }
2322
2323 return out
2324}
2325
2326func (ec *executionContext) _SetStatusOperation_author(ctx context.Context, field graphql.CollectedField, obj *operations.SetStatusOperation) graphql.Marshaler {
2327 rctx := graphql.GetResolverContext(ctx)
2328 rctx.Object = "SetStatusOperation"
2329 rctx.Args = nil
2330 rctx.Field = field
2331 rctx.PushField(field.Alias)
2332 defer rctx.Pop()
2333 res := obj.Author
2334 return ec._Person(ctx, field.Selections, &res)
2335}
2336
2337func (ec *executionContext) _SetStatusOperation_date(ctx context.Context, field graphql.CollectedField, obj *operations.SetStatusOperation) graphql.Marshaler {
2338 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{
2339 Object: "SetStatusOperation",
2340 Args: nil,
2341 Field: field,
2342 })
2343 return graphql.Defer(func() (ret graphql.Marshaler) {
2344 defer func() {
2345 if r := recover(); r != nil {
2346 userErr := ec.Recover(ctx, r)
2347 ec.Error(ctx, userErr)
2348 ret = graphql.Null
2349 }
2350 }()
2351
2352 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
2353 return ec.resolvers.SetStatusOperation_date(ctx, obj)
2354 })
2355 if err != nil {
2356 ec.Error(ctx, err)
2357 return graphql.Null
2358 }
2359 if resTmp == nil {
2360 return graphql.Null
2361 }
2362 res := resTmp.(time.Time)
2363 return graphql.MarshalTime(res)
2364 })
2365}
2366
2367func (ec *executionContext) _SetStatusOperation_status(ctx context.Context, field graphql.CollectedField, obj *operations.SetStatusOperation) graphql.Marshaler {
2368 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{
2369 Object: "SetStatusOperation",
2370 Args: nil,
2371 Field: field,
2372 })
2373 return graphql.Defer(func() (ret graphql.Marshaler) {
2374 defer func() {
2375 if r := recover(); r != nil {
2376 userErr := ec.Recover(ctx, r)
2377 ec.Error(ctx, userErr)
2378 ret = graphql.Null
2379 }
2380 }()
2381
2382 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
2383 return ec.resolvers.SetStatusOperation_status(ctx, obj)
2384 })
2385 if err != nil {
2386 ec.Error(ctx, err)
2387 return graphql.Null
2388 }
2389 if resTmp == nil {
2390 return graphql.Null
2391 }
2392 res := resTmp.(models.Status)
2393 return res
2394 })
2395}
2396
2397var setTitleOperationImplementors = []string{"SetTitleOperation", "Operation", "Authored"}
2398
2399// nolint: gocyclo, errcheck, gas, goconst
2400func (ec *executionContext) _SetTitleOperation(ctx context.Context, sel []query.Selection, obj *operations.SetTitleOperation) graphql.Marshaler {
2401 fields := graphql.CollectFields(ec.Doc, sel, setTitleOperationImplementors, ec.Variables)
2402
2403 out := graphql.NewOrderedMap(len(fields))
2404 for i, field := range fields {
2405 out.Keys[i] = field.Alias
2406
2407 switch field.Name {
2408 case "__typename":
2409 out.Values[i] = graphql.MarshalString("SetTitleOperation")
2410 case "author":
2411 out.Values[i] = ec._SetTitleOperation_author(ctx, field, obj)
2412 case "date":
2413 out.Values[i] = ec._SetTitleOperation_date(ctx, field, obj)
2414 case "title":
2415 out.Values[i] = ec._SetTitleOperation_title(ctx, field, obj)
2416 case "was":
2417 out.Values[i] = ec._SetTitleOperation_was(ctx, field, obj)
2418 default:
2419 panic("unknown field " + strconv.Quote(field.Name))
2420 }
2421 }
2422
2423 return out
2424}
2425
2426func (ec *executionContext) _SetTitleOperation_author(ctx context.Context, field graphql.CollectedField, obj *operations.SetTitleOperation) graphql.Marshaler {
2427 rctx := graphql.GetResolverContext(ctx)
2428 rctx.Object = "SetTitleOperation"
2429 rctx.Args = nil
2430 rctx.Field = field
2431 rctx.PushField(field.Alias)
2432 defer rctx.Pop()
2433 res := obj.Author
2434 return ec._Person(ctx, field.Selections, &res)
2435}
2436
2437func (ec *executionContext) _SetTitleOperation_date(ctx context.Context, field graphql.CollectedField, obj *operations.SetTitleOperation) graphql.Marshaler {
2438 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{
2439 Object: "SetTitleOperation",
2440 Args: nil,
2441 Field: field,
2442 })
2443 return graphql.Defer(func() (ret graphql.Marshaler) {
2444 defer func() {
2445 if r := recover(); r != nil {
2446 userErr := ec.Recover(ctx, r)
2447 ec.Error(ctx, userErr)
2448 ret = graphql.Null
2449 }
2450 }()
2451
2452 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
2453 return ec.resolvers.SetTitleOperation_date(ctx, obj)
2454 })
2455 if err != nil {
2456 ec.Error(ctx, err)
2457 return graphql.Null
2458 }
2459 if resTmp == nil {
2460 return graphql.Null
2461 }
2462 res := resTmp.(time.Time)
2463 return graphql.MarshalTime(res)
2464 })
2465}
2466
2467func (ec *executionContext) _SetTitleOperation_title(ctx context.Context, field graphql.CollectedField, obj *operations.SetTitleOperation) graphql.Marshaler {
2468 rctx := graphql.GetResolverContext(ctx)
2469 rctx.Object = "SetTitleOperation"
2470 rctx.Args = nil
2471 rctx.Field = field
2472 rctx.PushField(field.Alias)
2473 defer rctx.Pop()
2474 res := obj.Title
2475 return graphql.MarshalString(res)
2476}
2477
2478func (ec *executionContext) _SetTitleOperation_was(ctx context.Context, field graphql.CollectedField, obj *operations.SetTitleOperation) graphql.Marshaler {
2479 rctx := graphql.GetResolverContext(ctx)
2480 rctx.Object = "SetTitleOperation"
2481 rctx.Args = nil
2482 rctx.Field = field
2483 rctx.PushField(field.Alias)
2484 defer rctx.Pop()
2485 res := obj.Was
2486 return graphql.MarshalString(res)
2487}
2488
2489var __DirectiveImplementors = []string{"__Directive"}
2490
2491// nolint: gocyclo, errcheck, gas, goconst
2492func (ec *executionContext) ___Directive(ctx context.Context, sel []query.Selection, obj *introspection.Directive) graphql.Marshaler {
2493 fields := graphql.CollectFields(ec.Doc, sel, __DirectiveImplementors, ec.Variables)
2494
2495 out := graphql.NewOrderedMap(len(fields))
2496 for i, field := range fields {
2497 out.Keys[i] = field.Alias
2498
2499 switch field.Name {
2500 case "__typename":
2501 out.Values[i] = graphql.MarshalString("__Directive")
2502 case "name":
2503 out.Values[i] = ec.___Directive_name(ctx, field, obj)
2504 case "description":
2505 out.Values[i] = ec.___Directive_description(ctx, field, obj)
2506 case "locations":
2507 out.Values[i] = ec.___Directive_locations(ctx, field, obj)
2508 case "args":
2509 out.Values[i] = ec.___Directive_args(ctx, field, obj)
2510 default:
2511 panic("unknown field " + strconv.Quote(field.Name))
2512 }
2513 }
2514
2515 return out
2516}
2517
2518func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler {
2519 rctx := graphql.GetResolverContext(ctx)
2520 rctx.Object = "__Directive"
2521 rctx.Args = nil
2522 rctx.Field = field
2523 rctx.PushField(field.Alias)
2524 defer rctx.Pop()
2525 res := obj.Name()
2526 return graphql.MarshalString(res)
2527}
2528
2529func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler {
2530 rctx := graphql.GetResolverContext(ctx)
2531 rctx.Object = "__Directive"
2532 rctx.Args = nil
2533 rctx.Field = field
2534 rctx.PushField(field.Alias)
2535 defer rctx.Pop()
2536 res := obj.Description()
2537 if res == nil {
2538 return graphql.Null
2539 }
2540 return graphql.MarshalString(*res)
2541}
2542
2543func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler {
2544 rctx := graphql.GetResolverContext(ctx)
2545 rctx.Object = "__Directive"
2546 rctx.Args = nil
2547 rctx.Field = field
2548 rctx.PushField(field.Alias)
2549 defer rctx.Pop()
2550 res := obj.Locations()
2551 arr1 := graphql.Array{}
2552 for idx1 := range res {
2553 arr1 = append(arr1, func() graphql.Marshaler {
2554 rctx := graphql.GetResolverContext(ctx)
2555 rctx.PushIndex(idx1)
2556 defer rctx.Pop()
2557 return graphql.MarshalString(res[idx1])
2558 }())
2559 }
2560 return arr1
2561}
2562
2563func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler {
2564 rctx := graphql.GetResolverContext(ctx)
2565 rctx.Object = "__Directive"
2566 rctx.Args = nil
2567 rctx.Field = field
2568 rctx.PushField(field.Alias)
2569 defer rctx.Pop()
2570 res := obj.Args()
2571 arr1 := graphql.Array{}
2572 for idx1 := range res {
2573 arr1 = append(arr1, func() graphql.Marshaler {
2574 rctx := graphql.GetResolverContext(ctx)
2575 rctx.PushIndex(idx1)
2576 defer rctx.Pop()
2577 return ec.___InputValue(ctx, field.Selections, &res[idx1])
2578 }())
2579 }
2580 return arr1
2581}
2582
2583var __EnumValueImplementors = []string{"__EnumValue"}
2584
2585// nolint: gocyclo, errcheck, gas, goconst
2586func (ec *executionContext) ___EnumValue(ctx context.Context, sel []query.Selection, obj *introspection.EnumValue) graphql.Marshaler {
2587 fields := graphql.CollectFields(ec.Doc, sel, __EnumValueImplementors, ec.Variables)
2588
2589 out := graphql.NewOrderedMap(len(fields))
2590 for i, field := range fields {
2591 out.Keys[i] = field.Alias
2592
2593 switch field.Name {
2594 case "__typename":
2595 out.Values[i] = graphql.MarshalString("__EnumValue")
2596 case "name":
2597 out.Values[i] = ec.___EnumValue_name(ctx, field, obj)
2598 case "description":
2599 out.Values[i] = ec.___EnumValue_description(ctx, field, obj)
2600 case "isDeprecated":
2601 out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj)
2602 case "deprecationReason":
2603 out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj)
2604 default:
2605 panic("unknown field " + strconv.Quote(field.Name))
2606 }
2607 }
2608
2609 return out
2610}
2611
2612func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler {
2613 rctx := graphql.GetResolverContext(ctx)
2614 rctx.Object = "__EnumValue"
2615 rctx.Args = nil
2616 rctx.Field = field
2617 rctx.PushField(field.Alias)
2618 defer rctx.Pop()
2619 res := obj.Name()
2620 return graphql.MarshalString(res)
2621}
2622
2623func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler {
2624 rctx := graphql.GetResolverContext(ctx)
2625 rctx.Object = "__EnumValue"
2626 rctx.Args = nil
2627 rctx.Field = field
2628 rctx.PushField(field.Alias)
2629 defer rctx.Pop()
2630 res := obj.Description()
2631 if res == nil {
2632 return graphql.Null
2633 }
2634 return graphql.MarshalString(*res)
2635}
2636
2637func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler {
2638 rctx := graphql.GetResolverContext(ctx)
2639 rctx.Object = "__EnumValue"
2640 rctx.Args = nil
2641 rctx.Field = field
2642 rctx.PushField(field.Alias)
2643 defer rctx.Pop()
2644 res := obj.IsDeprecated()
2645 return graphql.MarshalBoolean(res)
2646}
2647
2648func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler {
2649 rctx := graphql.GetResolverContext(ctx)
2650 rctx.Object = "__EnumValue"
2651 rctx.Args = nil
2652 rctx.Field = field
2653 rctx.PushField(field.Alias)
2654 defer rctx.Pop()
2655 res := obj.DeprecationReason()
2656 if res == nil {
2657 return graphql.Null
2658 }
2659 return graphql.MarshalString(*res)
2660}
2661
2662var __FieldImplementors = []string{"__Field"}
2663
2664// nolint: gocyclo, errcheck, gas, goconst
2665func (ec *executionContext) ___Field(ctx context.Context, sel []query.Selection, obj *introspection.Field) graphql.Marshaler {
2666 fields := graphql.CollectFields(ec.Doc, sel, __FieldImplementors, ec.Variables)
2667
2668 out := graphql.NewOrderedMap(len(fields))
2669 for i, field := range fields {
2670 out.Keys[i] = field.Alias
2671
2672 switch field.Name {
2673 case "__typename":
2674 out.Values[i] = graphql.MarshalString("__Field")
2675 case "name":
2676 out.Values[i] = ec.___Field_name(ctx, field, obj)
2677 case "description":
2678 out.Values[i] = ec.___Field_description(ctx, field, obj)
2679 case "args":
2680 out.Values[i] = ec.___Field_args(ctx, field, obj)
2681 case "type":
2682 out.Values[i] = ec.___Field_type(ctx, field, obj)
2683 case "isDeprecated":
2684 out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj)
2685 case "deprecationReason":
2686 out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj)
2687 default:
2688 panic("unknown field " + strconv.Quote(field.Name))
2689 }
2690 }
2691
2692 return out
2693}
2694
2695func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {
2696 rctx := graphql.GetResolverContext(ctx)
2697 rctx.Object = "__Field"
2698 rctx.Args = nil
2699 rctx.Field = field
2700 rctx.PushField(field.Alias)
2701 defer rctx.Pop()
2702 res := obj.Name()
2703 return graphql.MarshalString(res)
2704}
2705
2706func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {
2707 rctx := graphql.GetResolverContext(ctx)
2708 rctx.Object = "__Field"
2709 rctx.Args = nil
2710 rctx.Field = field
2711 rctx.PushField(field.Alias)
2712 defer rctx.Pop()
2713 res := obj.Description()
2714 if res == nil {
2715 return graphql.Null
2716 }
2717 return graphql.MarshalString(*res)
2718}
2719
2720func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {
2721 rctx := graphql.GetResolverContext(ctx)
2722 rctx.Object = "__Field"
2723 rctx.Args = nil
2724 rctx.Field = field
2725 rctx.PushField(field.Alias)
2726 defer rctx.Pop()
2727 res := obj.Args()
2728 arr1 := graphql.Array{}
2729 for idx1 := range res {
2730 arr1 = append(arr1, func() graphql.Marshaler {
2731 rctx := graphql.GetResolverContext(ctx)
2732 rctx.PushIndex(idx1)
2733 defer rctx.Pop()
2734 return ec.___InputValue(ctx, field.Selections, &res[idx1])
2735 }())
2736 }
2737 return arr1
2738}
2739
2740func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {
2741 rctx := graphql.GetResolverContext(ctx)
2742 rctx.Object = "__Field"
2743 rctx.Args = nil
2744 rctx.Field = field
2745 rctx.PushField(field.Alias)
2746 defer rctx.Pop()
2747 res := obj.Type()
2748 return ec.___Type(ctx, field.Selections, &res)
2749}
2750
2751func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {
2752 rctx := graphql.GetResolverContext(ctx)
2753 rctx.Object = "__Field"
2754 rctx.Args = nil
2755 rctx.Field = field
2756 rctx.PushField(field.Alias)
2757 defer rctx.Pop()
2758 res := obj.IsDeprecated()
2759 return graphql.MarshalBoolean(res)
2760}
2761
2762func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {
2763 rctx := graphql.GetResolverContext(ctx)
2764 rctx.Object = "__Field"
2765 rctx.Args = nil
2766 rctx.Field = field
2767 rctx.PushField(field.Alias)
2768 defer rctx.Pop()
2769 res := obj.DeprecationReason()
2770 if res == nil {
2771 return graphql.Null
2772 }
2773 return graphql.MarshalString(*res)
2774}
2775
2776var __InputValueImplementors = []string{"__InputValue"}
2777
2778// nolint: gocyclo, errcheck, gas, goconst
2779func (ec *executionContext) ___InputValue(ctx context.Context, sel []query.Selection, obj *introspection.InputValue) graphql.Marshaler {
2780 fields := graphql.CollectFields(ec.Doc, sel, __InputValueImplementors, ec.Variables)
2781
2782 out := graphql.NewOrderedMap(len(fields))
2783 for i, field := range fields {
2784 out.Keys[i] = field.Alias
2785
2786 switch field.Name {
2787 case "__typename":
2788 out.Values[i] = graphql.MarshalString("__InputValue")
2789 case "name":
2790 out.Values[i] = ec.___InputValue_name(ctx, field, obj)
2791 case "description":
2792 out.Values[i] = ec.___InputValue_description(ctx, field, obj)
2793 case "type":
2794 out.Values[i] = ec.___InputValue_type(ctx, field, obj)
2795 case "defaultValue":
2796 out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj)
2797 default:
2798 panic("unknown field " + strconv.Quote(field.Name))
2799 }
2800 }
2801
2802 return out
2803}
2804
2805func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler {
2806 rctx := graphql.GetResolverContext(ctx)
2807 rctx.Object = "__InputValue"
2808 rctx.Args = nil
2809 rctx.Field = field
2810 rctx.PushField(field.Alias)
2811 defer rctx.Pop()
2812 res := obj.Name()
2813 return graphql.MarshalString(res)
2814}
2815
2816func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler {
2817 rctx := graphql.GetResolverContext(ctx)
2818 rctx.Object = "__InputValue"
2819 rctx.Args = nil
2820 rctx.Field = field
2821 rctx.PushField(field.Alias)
2822 defer rctx.Pop()
2823 res := obj.Description()
2824 if res == nil {
2825 return graphql.Null
2826 }
2827 return graphql.MarshalString(*res)
2828}
2829
2830func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler {
2831 rctx := graphql.GetResolverContext(ctx)
2832 rctx.Object = "__InputValue"
2833 rctx.Args = nil
2834 rctx.Field = field
2835 rctx.PushField(field.Alias)
2836 defer rctx.Pop()
2837 res := obj.Type()
2838 return ec.___Type(ctx, field.Selections, &res)
2839}
2840
2841func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler {
2842 rctx := graphql.GetResolverContext(ctx)
2843 rctx.Object = "__InputValue"
2844 rctx.Args = nil
2845 rctx.Field = field
2846 rctx.PushField(field.Alias)
2847 defer rctx.Pop()
2848 res := obj.DefaultValue()
2849 if res == nil {
2850 return graphql.Null
2851 }
2852 return graphql.MarshalString(*res)
2853}
2854
2855var __SchemaImplementors = []string{"__Schema"}
2856
2857// nolint: gocyclo, errcheck, gas, goconst
2858func (ec *executionContext) ___Schema(ctx context.Context, sel []query.Selection, obj *introspection.Schema) graphql.Marshaler {
2859 fields := graphql.CollectFields(ec.Doc, sel, __SchemaImplementors, ec.Variables)
2860
2861 out := graphql.NewOrderedMap(len(fields))
2862 for i, field := range fields {
2863 out.Keys[i] = field.Alias
2864
2865 switch field.Name {
2866 case "__typename":
2867 out.Values[i] = graphql.MarshalString("__Schema")
2868 case "types":
2869 out.Values[i] = ec.___Schema_types(ctx, field, obj)
2870 case "queryType":
2871 out.Values[i] = ec.___Schema_queryType(ctx, field, obj)
2872 case "mutationType":
2873 out.Values[i] = ec.___Schema_mutationType(ctx, field, obj)
2874 case "subscriptionType":
2875 out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj)
2876 case "directives":
2877 out.Values[i] = ec.___Schema_directives(ctx, field, obj)
2878 default:
2879 panic("unknown field " + strconv.Quote(field.Name))
2880 }
2881 }
2882
2883 return out
2884}
2885
2886func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler {
2887 rctx := graphql.GetResolverContext(ctx)
2888 rctx.Object = "__Schema"
2889 rctx.Args = nil
2890 rctx.Field = field
2891 rctx.PushField(field.Alias)
2892 defer rctx.Pop()
2893 res := obj.Types()
2894 arr1 := graphql.Array{}
2895 for idx1 := range res {
2896 arr1 = append(arr1, func() graphql.Marshaler {
2897 rctx := graphql.GetResolverContext(ctx)
2898 rctx.PushIndex(idx1)
2899 defer rctx.Pop()
2900 return ec.___Type(ctx, field.Selections, &res[idx1])
2901 }())
2902 }
2903 return arr1
2904}
2905
2906func (ec *executionContext) ___Schema_queryType(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.QueryType()
2914 return ec.___Type(ctx, field.Selections, &res)
2915}
2916
2917func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler {
2918 rctx := graphql.GetResolverContext(ctx)
2919 rctx.Object = "__Schema"
2920 rctx.Args = nil
2921 rctx.Field = field
2922 rctx.PushField(field.Alias)
2923 defer rctx.Pop()
2924 res := obj.MutationType()
2925 if res == nil {
2926 return graphql.Null
2927 }
2928 return ec.___Type(ctx, field.Selections, res)
2929}
2930
2931func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler {
2932 rctx := graphql.GetResolverContext(ctx)
2933 rctx.Object = "__Schema"
2934 rctx.Args = nil
2935 rctx.Field = field
2936 rctx.PushField(field.Alias)
2937 defer rctx.Pop()
2938 res := obj.SubscriptionType()
2939 if res == nil {
2940 return graphql.Null
2941 }
2942 return ec.___Type(ctx, field.Selections, res)
2943}
2944
2945func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler {
2946 rctx := graphql.GetResolverContext(ctx)
2947 rctx.Object = "__Schema"
2948 rctx.Args = nil
2949 rctx.Field = field
2950 rctx.PushField(field.Alias)
2951 defer rctx.Pop()
2952 res := obj.Directives()
2953 arr1 := graphql.Array{}
2954 for idx1 := range res {
2955 arr1 = append(arr1, func() graphql.Marshaler {
2956 rctx := graphql.GetResolverContext(ctx)
2957 rctx.PushIndex(idx1)
2958 defer rctx.Pop()
2959 return ec.___Directive(ctx, field.Selections, &res[idx1])
2960 }())
2961 }
2962 return arr1
2963}
2964
2965var __TypeImplementors = []string{"__Type"}
2966
2967// nolint: gocyclo, errcheck, gas, goconst
2968func (ec *executionContext) ___Type(ctx context.Context, sel []query.Selection, obj *introspection.Type) graphql.Marshaler {
2969 fields := graphql.CollectFields(ec.Doc, sel, __TypeImplementors, ec.Variables)
2970
2971 out := graphql.NewOrderedMap(len(fields))
2972 for i, field := range fields {
2973 out.Keys[i] = field.Alias
2974
2975 switch field.Name {
2976 case "__typename":
2977 out.Values[i] = graphql.MarshalString("__Type")
2978 case "kind":
2979 out.Values[i] = ec.___Type_kind(ctx, field, obj)
2980 case "name":
2981 out.Values[i] = ec.___Type_name(ctx, field, obj)
2982 case "description":
2983 out.Values[i] = ec.___Type_description(ctx, field, obj)
2984 case "fields":
2985 out.Values[i] = ec.___Type_fields(ctx, field, obj)
2986 case "interfaces":
2987 out.Values[i] = ec.___Type_interfaces(ctx, field, obj)
2988 case "possibleTypes":
2989 out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj)
2990 case "enumValues":
2991 out.Values[i] = ec.___Type_enumValues(ctx, field, obj)
2992 case "inputFields":
2993 out.Values[i] = ec.___Type_inputFields(ctx, field, obj)
2994 case "ofType":
2995 out.Values[i] = ec.___Type_ofType(ctx, field, obj)
2996 default:
2997 panic("unknown field " + strconv.Quote(field.Name))
2998 }
2999 }
3000
3001 return out
3002}
3003
3004func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
3005 rctx := graphql.GetResolverContext(ctx)
3006 rctx.Object = "__Type"
3007 rctx.Args = nil
3008 rctx.Field = field
3009 rctx.PushField(field.Alias)
3010 defer rctx.Pop()
3011 res := obj.Kind()
3012 return graphql.MarshalString(res)
3013}
3014
3015func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
3016 rctx := graphql.GetResolverContext(ctx)
3017 rctx.Object = "__Type"
3018 rctx.Args = nil
3019 rctx.Field = field
3020 rctx.PushField(field.Alias)
3021 defer rctx.Pop()
3022 res := obj.Name()
3023 if res == nil {
3024 return graphql.Null
3025 }
3026 return graphql.MarshalString(*res)
3027}
3028
3029func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
3030 rctx := graphql.GetResolverContext(ctx)
3031 rctx.Object = "__Type"
3032 rctx.Args = nil
3033 rctx.Field = field
3034 rctx.PushField(field.Alias)
3035 defer rctx.Pop()
3036 res := obj.Description()
3037 if res == nil {
3038 return graphql.Null
3039 }
3040 return graphql.MarshalString(*res)
3041}
3042
3043func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
3044 args := map[string]interface{}{}
3045 var arg0 bool
3046 if tmp, ok := field.Args["includeDeprecated"]; ok {
3047 var err error
3048 arg0, err = graphql.UnmarshalBoolean(tmp)
3049 if err != nil {
3050 ec.Error(ctx, err)
3051 return graphql.Null
3052 }
3053 }
3054 args["includeDeprecated"] = arg0
3055 rctx := graphql.GetResolverContext(ctx)
3056 rctx.Object = "__Type"
3057 rctx.Args = args
3058 rctx.Field = field
3059 rctx.PushField(field.Alias)
3060 defer rctx.Pop()
3061 res := obj.Fields(args["includeDeprecated"].(bool))
3062 arr1 := graphql.Array{}
3063 for idx1 := range res {
3064 arr1 = append(arr1, func() graphql.Marshaler {
3065 rctx := graphql.GetResolverContext(ctx)
3066 rctx.PushIndex(idx1)
3067 defer rctx.Pop()
3068 return ec.___Field(ctx, field.Selections, &res[idx1])
3069 }())
3070 }
3071 return arr1
3072}
3073
3074func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
3075 rctx := graphql.GetResolverContext(ctx)
3076 rctx.Object = "__Type"
3077 rctx.Args = nil
3078 rctx.Field = field
3079 rctx.PushField(field.Alias)
3080 defer rctx.Pop()
3081 res := obj.Interfaces()
3082 arr1 := graphql.Array{}
3083 for idx1 := range res {
3084 arr1 = append(arr1, func() graphql.Marshaler {
3085 rctx := graphql.GetResolverContext(ctx)
3086 rctx.PushIndex(idx1)
3087 defer rctx.Pop()
3088 return ec.___Type(ctx, field.Selections, &res[idx1])
3089 }())
3090 }
3091 return arr1
3092}
3093
3094func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
3095 rctx := graphql.GetResolverContext(ctx)
3096 rctx.Object = "__Type"
3097 rctx.Args = nil
3098 rctx.Field = field
3099 rctx.PushField(field.Alias)
3100 defer rctx.Pop()
3101 res := obj.PossibleTypes()
3102 arr1 := graphql.Array{}
3103 for idx1 := range res {
3104 arr1 = append(arr1, func() graphql.Marshaler {
3105 rctx := graphql.GetResolverContext(ctx)
3106 rctx.PushIndex(idx1)
3107 defer rctx.Pop()
3108 return ec.___Type(ctx, field.Selections, &res[idx1])
3109 }())
3110 }
3111 return arr1
3112}
3113
3114func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
3115 args := map[string]interface{}{}
3116 var arg0 bool
3117 if tmp, ok := field.Args["includeDeprecated"]; ok {
3118 var err error
3119 arg0, err = graphql.UnmarshalBoolean(tmp)
3120 if err != nil {
3121 ec.Error(ctx, err)
3122 return graphql.Null
3123 }
3124 }
3125 args["includeDeprecated"] = arg0
3126 rctx := graphql.GetResolverContext(ctx)
3127 rctx.Object = "__Type"
3128 rctx.Args = args
3129 rctx.Field = field
3130 rctx.PushField(field.Alias)
3131 defer rctx.Pop()
3132 res := obj.EnumValues(args["includeDeprecated"].(bool))
3133 arr1 := graphql.Array{}
3134 for idx1 := range res {
3135 arr1 = append(arr1, func() graphql.Marshaler {
3136 rctx := graphql.GetResolverContext(ctx)
3137 rctx.PushIndex(idx1)
3138 defer rctx.Pop()
3139 return ec.___EnumValue(ctx, field.Selections, &res[idx1])
3140 }())
3141 }
3142 return arr1
3143}
3144
3145func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
3146 rctx := graphql.GetResolverContext(ctx)
3147 rctx.Object = "__Type"
3148 rctx.Args = nil
3149 rctx.Field = field
3150 rctx.PushField(field.Alias)
3151 defer rctx.Pop()
3152 res := obj.InputFields()
3153 arr1 := graphql.Array{}
3154 for idx1 := range res {
3155 arr1 = append(arr1, func() graphql.Marshaler {
3156 rctx := graphql.GetResolverContext(ctx)
3157 rctx.PushIndex(idx1)
3158 defer rctx.Pop()
3159 return ec.___InputValue(ctx, field.Selections, &res[idx1])
3160 }())
3161 }
3162 return arr1
3163}
3164
3165func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
3166 rctx := graphql.GetResolverContext(ctx)
3167 rctx.Object = "__Type"
3168 rctx.Args = nil
3169 rctx.Field = field
3170 rctx.PushField(field.Alias)
3171 defer rctx.Pop()
3172 res := obj.OfType()
3173 if res == nil {
3174 return graphql.Null
3175 }
3176 return ec.___Type(ctx, field.Selections, res)
3177}
3178
3179func (ec *executionContext) _Authored(ctx context.Context, sel []query.Selection, obj *models.Authored) graphql.Marshaler {
3180 switch obj := (*obj).(type) {
3181 case nil:
3182 return graphql.Null
3183 case bug.Comment:
3184 return ec._Comment(ctx, sel, &obj)
3185 case *bug.Comment:
3186 return ec._Comment(ctx, sel, obj)
3187 case operations.CreateOperation:
3188 return ec._CreateOperation(ctx, sel, &obj)
3189 case *operations.CreateOperation:
3190 return ec._CreateOperation(ctx, sel, obj)
3191 case operations.SetTitleOperation:
3192 return ec._SetTitleOperation(ctx, sel, &obj)
3193 case *operations.SetTitleOperation:
3194 return ec._SetTitleOperation(ctx, sel, obj)
3195 case operations.AddCommentOperation:
3196 return ec._AddCommentOperation(ctx, sel, &obj)
3197 case *operations.AddCommentOperation:
3198 return ec._AddCommentOperation(ctx, sel, obj)
3199 case operations.SetStatusOperation:
3200 return ec._SetStatusOperation(ctx, sel, &obj)
3201 case *operations.SetStatusOperation:
3202 return ec._SetStatusOperation(ctx, sel, obj)
3203 case operations.LabelChangeOperation:
3204 return ec._LabelChangeOperation(ctx, sel, &obj)
3205 case *operations.LabelChangeOperation:
3206 return ec._LabelChangeOperation(ctx, sel, obj)
3207 default:
3208 panic(fmt.Errorf("unexpected type %T", obj))
3209 }
3210}
3211
3212func (ec *executionContext) _Operation(ctx context.Context, sel []query.Selection, obj *bug.Operation) graphql.Marshaler {
3213 switch obj := (*obj).(type) {
3214 case nil:
3215 return graphql.Null
3216 case operations.CreateOperation:
3217 return ec._CreateOperation(ctx, sel, &obj)
3218 case *operations.CreateOperation:
3219 return ec._CreateOperation(ctx, sel, obj)
3220 case operations.SetTitleOperation:
3221 return ec._SetTitleOperation(ctx, sel, &obj)
3222 case *operations.SetTitleOperation:
3223 return ec._SetTitleOperation(ctx, sel, obj)
3224 case operations.AddCommentOperation:
3225 return ec._AddCommentOperation(ctx, sel, &obj)
3226 case *operations.AddCommentOperation:
3227 return ec._AddCommentOperation(ctx, sel, obj)
3228 case operations.SetStatusOperation:
3229 return ec._SetStatusOperation(ctx, sel, &obj)
3230 case *operations.SetStatusOperation:
3231 return ec._SetStatusOperation(ctx, sel, obj)
3232 case operations.LabelChangeOperation:
3233 return ec._LabelChangeOperation(ctx, sel, &obj)
3234 case *operations.LabelChangeOperation:
3235 return ec._LabelChangeOperation(ctx, sel, obj)
3236 default:
3237 panic(fmt.Errorf("unexpected type %T", obj))
3238 }
3239}
3240
3241func (ec *executionContext) introspectSchema() *introspection.Schema {
3242 return introspection.WrapSchema(parsedSchema)
3243}
3244
3245func (ec *executionContext) introspectType(name string) *introspection.Type {
3246 t := parsedSchema.Resolve(name)
3247 if t == nil {
3248 return nil
3249 }
3250 return introspection.WrapType(t)
3251}
3252
3253var parsedSchema = schema.MustParse(`scalar Time
3254scalar Label
3255scalar Hash
3256
3257# Information about pagination in a connection.
3258type PageInfo {
3259 # When paginating forwards, are there more items?
3260 hasNextPage: Boolean!
3261 # When paginating backwards, are there more items?
3262 hasPreviousPage: Boolean!
3263 # When paginating backwards, the cursor to continue.
3264 startCursor: String!
3265 # When paginating forwards, the cursor to continue.
3266 endCursor: String!
3267}
3268
3269# Represents an person in a git object.
3270type Person {
3271 # The email of the person.
3272 email: String
3273
3274 # The name of the person.
3275 name: String
3276}
3277
3278type CommentConnection {
3279 edges: [CommentEdge!]!
3280 nodes: [Comment!]!
3281 pageInfo: PageInfo!
3282 totalCount: Int!
3283}
3284
3285type CommentEdge {
3286 cursor: String!
3287 node: Comment!
3288}
3289
3290# Represents a comment on a bug.
3291type Comment implements Authored {
3292 # The author of this comment.
3293 author: Person!
3294
3295 # The message of this comment.
3296 message: String!
3297
3298 # All media's hash referenced in this comment
3299 files: [Hash!]!
3300}
3301
3302enum Status {
3303 OPEN
3304 CLOSED
3305}
3306
3307# An object that has an author.
3308interface Authored {
3309 # The author of this object.
3310 author: Person!
3311}
3312
3313type OperationConnection {
3314 edges: [OperationEdge!]!
3315 nodes: [Operation!]!
3316 pageInfo: PageInfo!
3317 totalCount: Int!
3318}
3319
3320type OperationEdge {
3321 cursor: String!
3322 node: Operation!
3323}
3324
3325# An operation applied to a bug.
3326interface Operation {
3327 # The operations author.
3328 author: Person!
3329 # The datetime when this operation was issued.
3330 date: Time!
3331}
3332
3333type CreateOperation implements Operation, Authored {
3334 author: Person!
3335 date: Time!
3336
3337 title: String!
3338 message: String!
3339 files: [Hash!]!
3340}
3341
3342type SetTitleOperation implements Operation, Authored {
3343 author: Person!
3344 date: Time!
3345
3346 title: String!
3347 was: String!
3348}
3349
3350type AddCommentOperation implements Operation, Authored {
3351 author: Person!
3352 date: Time!
3353
3354 message: String!
3355 files: [Hash!]!
3356}
3357
3358type SetStatusOperation implements Operation, Authored {
3359 author: Person!
3360 date: Time!
3361
3362 status: Status!
3363}
3364
3365type LabelChangeOperation implements Operation, Authored {
3366 author: Person!
3367 date: Time!
3368
3369 added: [Label!]!
3370 removed: [Label!]!
3371}
3372
3373# The connection type for Bug.
3374type BugConnection {
3375 # A list of edges.
3376 edges: [BugEdge!]!
3377 nodes: [Bug!]!
3378 # Information to aid in pagination.
3379 pageInfo: PageInfo!
3380 # Identifies the total count of items in the connection.
3381 totalCount: Int!
3382}
3383
3384# An edge in a connection.
3385type BugEdge {
3386 # A cursor for use in pagination.
3387 cursor: String!
3388 # The item at the end of the edge.
3389 node: Bug!
3390}
3391
3392type Bug {
3393 id: String!
3394 humanId: String!
3395 status: Status!
3396 title: String!
3397 labels: [Label!]!
3398 author: Person!
3399 createdAt: Time!
3400 lastEdit: Time!
3401
3402 comments(
3403 # Returns the elements in the list that come after the specified cursor.
3404 after: String
3405 # Returns the elements in the list that come before the specified cursor.
3406 before: String
3407 # Returns the first _n_ elements from the list.
3408 first: Int
3409 # Returns the last _n_ elements from the list.
3410 last: Int
3411 ): CommentConnection!
3412
3413 operations(
3414 # Returns the elements in the list that come after the specified cursor.
3415 after: String
3416 # Returns the elements in the list that come before the specified cursor.
3417 before: String
3418 # Returns the first _n_ elements from the list.
3419 first: Int
3420 # Returns the last _n_ elements from the list.
3421 last: Int
3422 ): OperationConnection!
3423}
3424
3425type Repository {
3426 allBugs(
3427 # Returns the elements in the list that come after the specified cursor.
3428 after: String
3429 # Returns the elements in the list that come before the specified cursor.
3430 before: String
3431 # Returns the first _n_ elements from the list.
3432 first: Int
3433 # Returns the last _n_ elements from the list.
3434 last: Int
3435 ): BugConnection!
3436 bug(prefix: String!): Bug
3437}
3438
3439type Query {
3440 defaultRepository: Repository
3441 repository(id: String!): Repository
3442}
3443
3444type Mutation {
3445 newBug(repoRef: String, title: String!, message: String!, files: [Hash!]): Bug!
3446
3447 addComment(repoRef: String, prefix: String!, message: String!, files: [Hash!]): Bug!
3448 changeLabels(repoRef: String, prefix: String!, added: [String!], removed: [String!]): Bug!
3449 open(repoRef: String, prefix: String!): Bug!
3450 close(repoRef: String, prefix: String!): Bug!
3451 setTitle(repoRef: String, prefix: String!, title: String!): Bug!
3452
3453 commit(repoRef: String, prefix: String!): Bug!
3454}
3455`)