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 default:
2417 panic("unknown field " + strconv.Quote(field.Name))
2418 }
2419 }
2420
2421 return out
2422}
2423
2424func (ec *executionContext) _SetTitleOperation_author(ctx context.Context, field graphql.CollectedField, obj *operations.SetTitleOperation) graphql.Marshaler {
2425 rctx := graphql.GetResolverContext(ctx)
2426 rctx.Object = "SetTitleOperation"
2427 rctx.Args = nil
2428 rctx.Field = field
2429 rctx.PushField(field.Alias)
2430 defer rctx.Pop()
2431 res := obj.Author
2432 return ec._Person(ctx, field.Selections, &res)
2433}
2434
2435func (ec *executionContext) _SetTitleOperation_date(ctx context.Context, field graphql.CollectedField, obj *operations.SetTitleOperation) graphql.Marshaler {
2436 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{
2437 Object: "SetTitleOperation",
2438 Args: nil,
2439 Field: field,
2440 })
2441 return graphql.Defer(func() (ret graphql.Marshaler) {
2442 defer func() {
2443 if r := recover(); r != nil {
2444 userErr := ec.Recover(ctx, r)
2445 ec.Error(ctx, userErr)
2446 ret = graphql.Null
2447 }
2448 }()
2449
2450 resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) {
2451 return ec.resolvers.SetTitleOperation_date(ctx, obj)
2452 })
2453 if err != nil {
2454 ec.Error(ctx, err)
2455 return graphql.Null
2456 }
2457 if resTmp == nil {
2458 return graphql.Null
2459 }
2460 res := resTmp.(time.Time)
2461 return graphql.MarshalTime(res)
2462 })
2463}
2464
2465func (ec *executionContext) _SetTitleOperation_title(ctx context.Context, field graphql.CollectedField, obj *operations.SetTitleOperation) graphql.Marshaler {
2466 rctx := graphql.GetResolverContext(ctx)
2467 rctx.Object = "SetTitleOperation"
2468 rctx.Args = nil
2469 rctx.Field = field
2470 rctx.PushField(field.Alias)
2471 defer rctx.Pop()
2472 res := obj.Title
2473 return graphql.MarshalString(res)
2474}
2475
2476var __DirectiveImplementors = []string{"__Directive"}
2477
2478// nolint: gocyclo, errcheck, gas, goconst
2479func (ec *executionContext) ___Directive(ctx context.Context, sel []query.Selection, obj *introspection.Directive) graphql.Marshaler {
2480 fields := graphql.CollectFields(ec.Doc, sel, __DirectiveImplementors, ec.Variables)
2481
2482 out := graphql.NewOrderedMap(len(fields))
2483 for i, field := range fields {
2484 out.Keys[i] = field.Alias
2485
2486 switch field.Name {
2487 case "__typename":
2488 out.Values[i] = graphql.MarshalString("__Directive")
2489 case "name":
2490 out.Values[i] = ec.___Directive_name(ctx, field, obj)
2491 case "description":
2492 out.Values[i] = ec.___Directive_description(ctx, field, obj)
2493 case "locations":
2494 out.Values[i] = ec.___Directive_locations(ctx, field, obj)
2495 case "args":
2496 out.Values[i] = ec.___Directive_args(ctx, field, obj)
2497 default:
2498 panic("unknown field " + strconv.Quote(field.Name))
2499 }
2500 }
2501
2502 return out
2503}
2504
2505func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler {
2506 rctx := graphql.GetResolverContext(ctx)
2507 rctx.Object = "__Directive"
2508 rctx.Args = nil
2509 rctx.Field = field
2510 rctx.PushField(field.Alias)
2511 defer rctx.Pop()
2512 res := obj.Name()
2513 return graphql.MarshalString(res)
2514}
2515
2516func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler {
2517 rctx := graphql.GetResolverContext(ctx)
2518 rctx.Object = "__Directive"
2519 rctx.Args = nil
2520 rctx.Field = field
2521 rctx.PushField(field.Alias)
2522 defer rctx.Pop()
2523 res := obj.Description()
2524 if res == nil {
2525 return graphql.Null
2526 }
2527 return graphql.MarshalString(*res)
2528}
2529
2530func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler {
2531 rctx := graphql.GetResolverContext(ctx)
2532 rctx.Object = "__Directive"
2533 rctx.Args = nil
2534 rctx.Field = field
2535 rctx.PushField(field.Alias)
2536 defer rctx.Pop()
2537 res := obj.Locations()
2538 arr1 := graphql.Array{}
2539 for idx1 := range res {
2540 arr1 = append(arr1, func() graphql.Marshaler {
2541 rctx := graphql.GetResolverContext(ctx)
2542 rctx.PushIndex(idx1)
2543 defer rctx.Pop()
2544 return graphql.MarshalString(res[idx1])
2545 }())
2546 }
2547 return arr1
2548}
2549
2550func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler {
2551 rctx := graphql.GetResolverContext(ctx)
2552 rctx.Object = "__Directive"
2553 rctx.Args = nil
2554 rctx.Field = field
2555 rctx.PushField(field.Alias)
2556 defer rctx.Pop()
2557 res := obj.Args()
2558 arr1 := graphql.Array{}
2559 for idx1 := range res {
2560 arr1 = append(arr1, func() graphql.Marshaler {
2561 rctx := graphql.GetResolverContext(ctx)
2562 rctx.PushIndex(idx1)
2563 defer rctx.Pop()
2564 return ec.___InputValue(ctx, field.Selections, &res[idx1])
2565 }())
2566 }
2567 return arr1
2568}
2569
2570var __EnumValueImplementors = []string{"__EnumValue"}
2571
2572// nolint: gocyclo, errcheck, gas, goconst
2573func (ec *executionContext) ___EnumValue(ctx context.Context, sel []query.Selection, obj *introspection.EnumValue) graphql.Marshaler {
2574 fields := graphql.CollectFields(ec.Doc, sel, __EnumValueImplementors, ec.Variables)
2575
2576 out := graphql.NewOrderedMap(len(fields))
2577 for i, field := range fields {
2578 out.Keys[i] = field.Alias
2579
2580 switch field.Name {
2581 case "__typename":
2582 out.Values[i] = graphql.MarshalString("__EnumValue")
2583 case "name":
2584 out.Values[i] = ec.___EnumValue_name(ctx, field, obj)
2585 case "description":
2586 out.Values[i] = ec.___EnumValue_description(ctx, field, obj)
2587 case "isDeprecated":
2588 out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj)
2589 case "deprecationReason":
2590 out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj)
2591 default:
2592 panic("unknown field " + strconv.Quote(field.Name))
2593 }
2594 }
2595
2596 return out
2597}
2598
2599func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler {
2600 rctx := graphql.GetResolverContext(ctx)
2601 rctx.Object = "__EnumValue"
2602 rctx.Args = nil
2603 rctx.Field = field
2604 rctx.PushField(field.Alias)
2605 defer rctx.Pop()
2606 res := obj.Name()
2607 return graphql.MarshalString(res)
2608}
2609
2610func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler {
2611 rctx := graphql.GetResolverContext(ctx)
2612 rctx.Object = "__EnumValue"
2613 rctx.Args = nil
2614 rctx.Field = field
2615 rctx.PushField(field.Alias)
2616 defer rctx.Pop()
2617 res := obj.Description()
2618 if res == nil {
2619 return graphql.Null
2620 }
2621 return graphql.MarshalString(*res)
2622}
2623
2624func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler {
2625 rctx := graphql.GetResolverContext(ctx)
2626 rctx.Object = "__EnumValue"
2627 rctx.Args = nil
2628 rctx.Field = field
2629 rctx.PushField(field.Alias)
2630 defer rctx.Pop()
2631 res := obj.IsDeprecated()
2632 return graphql.MarshalBoolean(res)
2633}
2634
2635func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler {
2636 rctx := graphql.GetResolverContext(ctx)
2637 rctx.Object = "__EnumValue"
2638 rctx.Args = nil
2639 rctx.Field = field
2640 rctx.PushField(field.Alias)
2641 defer rctx.Pop()
2642 res := obj.DeprecationReason()
2643 if res == nil {
2644 return graphql.Null
2645 }
2646 return graphql.MarshalString(*res)
2647}
2648
2649var __FieldImplementors = []string{"__Field"}
2650
2651// nolint: gocyclo, errcheck, gas, goconst
2652func (ec *executionContext) ___Field(ctx context.Context, sel []query.Selection, obj *introspection.Field) graphql.Marshaler {
2653 fields := graphql.CollectFields(ec.Doc, sel, __FieldImplementors, ec.Variables)
2654
2655 out := graphql.NewOrderedMap(len(fields))
2656 for i, field := range fields {
2657 out.Keys[i] = field.Alias
2658
2659 switch field.Name {
2660 case "__typename":
2661 out.Values[i] = graphql.MarshalString("__Field")
2662 case "name":
2663 out.Values[i] = ec.___Field_name(ctx, field, obj)
2664 case "description":
2665 out.Values[i] = ec.___Field_description(ctx, field, obj)
2666 case "args":
2667 out.Values[i] = ec.___Field_args(ctx, field, obj)
2668 case "type":
2669 out.Values[i] = ec.___Field_type(ctx, field, obj)
2670 case "isDeprecated":
2671 out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj)
2672 case "deprecationReason":
2673 out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj)
2674 default:
2675 panic("unknown field " + strconv.Quote(field.Name))
2676 }
2677 }
2678
2679 return out
2680}
2681
2682func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {
2683 rctx := graphql.GetResolverContext(ctx)
2684 rctx.Object = "__Field"
2685 rctx.Args = nil
2686 rctx.Field = field
2687 rctx.PushField(field.Alias)
2688 defer rctx.Pop()
2689 res := obj.Name()
2690 return graphql.MarshalString(res)
2691}
2692
2693func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {
2694 rctx := graphql.GetResolverContext(ctx)
2695 rctx.Object = "__Field"
2696 rctx.Args = nil
2697 rctx.Field = field
2698 rctx.PushField(field.Alias)
2699 defer rctx.Pop()
2700 res := obj.Description()
2701 if res == nil {
2702 return graphql.Null
2703 }
2704 return graphql.MarshalString(*res)
2705}
2706
2707func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {
2708 rctx := graphql.GetResolverContext(ctx)
2709 rctx.Object = "__Field"
2710 rctx.Args = nil
2711 rctx.Field = field
2712 rctx.PushField(field.Alias)
2713 defer rctx.Pop()
2714 res := obj.Args()
2715 arr1 := graphql.Array{}
2716 for idx1 := range res {
2717 arr1 = append(arr1, func() graphql.Marshaler {
2718 rctx := graphql.GetResolverContext(ctx)
2719 rctx.PushIndex(idx1)
2720 defer rctx.Pop()
2721 return ec.___InputValue(ctx, field.Selections, &res[idx1])
2722 }())
2723 }
2724 return arr1
2725}
2726
2727func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {
2728 rctx := graphql.GetResolverContext(ctx)
2729 rctx.Object = "__Field"
2730 rctx.Args = nil
2731 rctx.Field = field
2732 rctx.PushField(field.Alias)
2733 defer rctx.Pop()
2734 res := obj.Type()
2735 return ec.___Type(ctx, field.Selections, &res)
2736}
2737
2738func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {
2739 rctx := graphql.GetResolverContext(ctx)
2740 rctx.Object = "__Field"
2741 rctx.Args = nil
2742 rctx.Field = field
2743 rctx.PushField(field.Alias)
2744 defer rctx.Pop()
2745 res := obj.IsDeprecated()
2746 return graphql.MarshalBoolean(res)
2747}
2748
2749func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler {
2750 rctx := graphql.GetResolverContext(ctx)
2751 rctx.Object = "__Field"
2752 rctx.Args = nil
2753 rctx.Field = field
2754 rctx.PushField(field.Alias)
2755 defer rctx.Pop()
2756 res := obj.DeprecationReason()
2757 if res == nil {
2758 return graphql.Null
2759 }
2760 return graphql.MarshalString(*res)
2761}
2762
2763var __InputValueImplementors = []string{"__InputValue"}
2764
2765// nolint: gocyclo, errcheck, gas, goconst
2766func (ec *executionContext) ___InputValue(ctx context.Context, sel []query.Selection, obj *introspection.InputValue) graphql.Marshaler {
2767 fields := graphql.CollectFields(ec.Doc, sel, __InputValueImplementors, ec.Variables)
2768
2769 out := graphql.NewOrderedMap(len(fields))
2770 for i, field := range fields {
2771 out.Keys[i] = field.Alias
2772
2773 switch field.Name {
2774 case "__typename":
2775 out.Values[i] = graphql.MarshalString("__InputValue")
2776 case "name":
2777 out.Values[i] = ec.___InputValue_name(ctx, field, obj)
2778 case "description":
2779 out.Values[i] = ec.___InputValue_description(ctx, field, obj)
2780 case "type":
2781 out.Values[i] = ec.___InputValue_type(ctx, field, obj)
2782 case "defaultValue":
2783 out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj)
2784 default:
2785 panic("unknown field " + strconv.Quote(field.Name))
2786 }
2787 }
2788
2789 return out
2790}
2791
2792func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler {
2793 rctx := graphql.GetResolverContext(ctx)
2794 rctx.Object = "__InputValue"
2795 rctx.Args = nil
2796 rctx.Field = field
2797 rctx.PushField(field.Alias)
2798 defer rctx.Pop()
2799 res := obj.Name()
2800 return graphql.MarshalString(res)
2801}
2802
2803func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler {
2804 rctx := graphql.GetResolverContext(ctx)
2805 rctx.Object = "__InputValue"
2806 rctx.Args = nil
2807 rctx.Field = field
2808 rctx.PushField(field.Alias)
2809 defer rctx.Pop()
2810 res := obj.Description()
2811 if res == nil {
2812 return graphql.Null
2813 }
2814 return graphql.MarshalString(*res)
2815}
2816
2817func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler {
2818 rctx := graphql.GetResolverContext(ctx)
2819 rctx.Object = "__InputValue"
2820 rctx.Args = nil
2821 rctx.Field = field
2822 rctx.PushField(field.Alias)
2823 defer rctx.Pop()
2824 res := obj.Type()
2825 return ec.___Type(ctx, field.Selections, &res)
2826}
2827
2828func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler {
2829 rctx := graphql.GetResolverContext(ctx)
2830 rctx.Object = "__InputValue"
2831 rctx.Args = nil
2832 rctx.Field = field
2833 rctx.PushField(field.Alias)
2834 defer rctx.Pop()
2835 res := obj.DefaultValue()
2836 if res == nil {
2837 return graphql.Null
2838 }
2839 return graphql.MarshalString(*res)
2840}
2841
2842var __SchemaImplementors = []string{"__Schema"}
2843
2844// nolint: gocyclo, errcheck, gas, goconst
2845func (ec *executionContext) ___Schema(ctx context.Context, sel []query.Selection, obj *introspection.Schema) graphql.Marshaler {
2846 fields := graphql.CollectFields(ec.Doc, sel, __SchemaImplementors, ec.Variables)
2847
2848 out := graphql.NewOrderedMap(len(fields))
2849 for i, field := range fields {
2850 out.Keys[i] = field.Alias
2851
2852 switch field.Name {
2853 case "__typename":
2854 out.Values[i] = graphql.MarshalString("__Schema")
2855 case "types":
2856 out.Values[i] = ec.___Schema_types(ctx, field, obj)
2857 case "queryType":
2858 out.Values[i] = ec.___Schema_queryType(ctx, field, obj)
2859 case "mutationType":
2860 out.Values[i] = ec.___Schema_mutationType(ctx, field, obj)
2861 case "subscriptionType":
2862 out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj)
2863 case "directives":
2864 out.Values[i] = ec.___Schema_directives(ctx, field, obj)
2865 default:
2866 panic("unknown field " + strconv.Quote(field.Name))
2867 }
2868 }
2869
2870 return out
2871}
2872
2873func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler {
2874 rctx := graphql.GetResolverContext(ctx)
2875 rctx.Object = "__Schema"
2876 rctx.Args = nil
2877 rctx.Field = field
2878 rctx.PushField(field.Alias)
2879 defer rctx.Pop()
2880 res := obj.Types()
2881 arr1 := graphql.Array{}
2882 for idx1 := range res {
2883 arr1 = append(arr1, func() graphql.Marshaler {
2884 rctx := graphql.GetResolverContext(ctx)
2885 rctx.PushIndex(idx1)
2886 defer rctx.Pop()
2887 return ec.___Type(ctx, field.Selections, &res[idx1])
2888 }())
2889 }
2890 return arr1
2891}
2892
2893func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler {
2894 rctx := graphql.GetResolverContext(ctx)
2895 rctx.Object = "__Schema"
2896 rctx.Args = nil
2897 rctx.Field = field
2898 rctx.PushField(field.Alias)
2899 defer rctx.Pop()
2900 res := obj.QueryType()
2901 return ec.___Type(ctx, field.Selections, &res)
2902}
2903
2904func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler {
2905 rctx := graphql.GetResolverContext(ctx)
2906 rctx.Object = "__Schema"
2907 rctx.Args = nil
2908 rctx.Field = field
2909 rctx.PushField(field.Alias)
2910 defer rctx.Pop()
2911 res := obj.MutationType()
2912 if res == nil {
2913 return graphql.Null
2914 }
2915 return ec.___Type(ctx, field.Selections, res)
2916}
2917
2918func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler {
2919 rctx := graphql.GetResolverContext(ctx)
2920 rctx.Object = "__Schema"
2921 rctx.Args = nil
2922 rctx.Field = field
2923 rctx.PushField(field.Alias)
2924 defer rctx.Pop()
2925 res := obj.SubscriptionType()
2926 if res == nil {
2927 return graphql.Null
2928 }
2929 return ec.___Type(ctx, field.Selections, res)
2930}
2931
2932func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler {
2933 rctx := graphql.GetResolverContext(ctx)
2934 rctx.Object = "__Schema"
2935 rctx.Args = nil
2936 rctx.Field = field
2937 rctx.PushField(field.Alias)
2938 defer rctx.Pop()
2939 res := obj.Directives()
2940 arr1 := graphql.Array{}
2941 for idx1 := range res {
2942 arr1 = append(arr1, func() graphql.Marshaler {
2943 rctx := graphql.GetResolverContext(ctx)
2944 rctx.PushIndex(idx1)
2945 defer rctx.Pop()
2946 return ec.___Directive(ctx, field.Selections, &res[idx1])
2947 }())
2948 }
2949 return arr1
2950}
2951
2952var __TypeImplementors = []string{"__Type"}
2953
2954// nolint: gocyclo, errcheck, gas, goconst
2955func (ec *executionContext) ___Type(ctx context.Context, sel []query.Selection, obj *introspection.Type) graphql.Marshaler {
2956 fields := graphql.CollectFields(ec.Doc, sel, __TypeImplementors, ec.Variables)
2957
2958 out := graphql.NewOrderedMap(len(fields))
2959 for i, field := range fields {
2960 out.Keys[i] = field.Alias
2961
2962 switch field.Name {
2963 case "__typename":
2964 out.Values[i] = graphql.MarshalString("__Type")
2965 case "kind":
2966 out.Values[i] = ec.___Type_kind(ctx, field, obj)
2967 case "name":
2968 out.Values[i] = ec.___Type_name(ctx, field, obj)
2969 case "description":
2970 out.Values[i] = ec.___Type_description(ctx, field, obj)
2971 case "fields":
2972 out.Values[i] = ec.___Type_fields(ctx, field, obj)
2973 case "interfaces":
2974 out.Values[i] = ec.___Type_interfaces(ctx, field, obj)
2975 case "possibleTypes":
2976 out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj)
2977 case "enumValues":
2978 out.Values[i] = ec.___Type_enumValues(ctx, field, obj)
2979 case "inputFields":
2980 out.Values[i] = ec.___Type_inputFields(ctx, field, obj)
2981 case "ofType":
2982 out.Values[i] = ec.___Type_ofType(ctx, field, obj)
2983 default:
2984 panic("unknown field " + strconv.Quote(field.Name))
2985 }
2986 }
2987
2988 return out
2989}
2990
2991func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
2992 rctx := graphql.GetResolverContext(ctx)
2993 rctx.Object = "__Type"
2994 rctx.Args = nil
2995 rctx.Field = field
2996 rctx.PushField(field.Alias)
2997 defer rctx.Pop()
2998 res := obj.Kind()
2999 return graphql.MarshalString(res)
3000}
3001
3002func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
3003 rctx := graphql.GetResolverContext(ctx)
3004 rctx.Object = "__Type"
3005 rctx.Args = nil
3006 rctx.Field = field
3007 rctx.PushField(field.Alias)
3008 defer rctx.Pop()
3009 res := obj.Name()
3010 if res == nil {
3011 return graphql.Null
3012 }
3013 return graphql.MarshalString(*res)
3014}
3015
3016func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
3017 rctx := graphql.GetResolverContext(ctx)
3018 rctx.Object = "__Type"
3019 rctx.Args = nil
3020 rctx.Field = field
3021 rctx.PushField(field.Alias)
3022 defer rctx.Pop()
3023 res := obj.Description()
3024 if res == nil {
3025 return graphql.Null
3026 }
3027 return graphql.MarshalString(*res)
3028}
3029
3030func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
3031 args := map[string]interface{}{}
3032 var arg0 bool
3033 if tmp, ok := field.Args["includeDeprecated"]; ok {
3034 var err error
3035 arg0, err = graphql.UnmarshalBoolean(tmp)
3036 if err != nil {
3037 ec.Error(ctx, err)
3038 return graphql.Null
3039 }
3040 }
3041 args["includeDeprecated"] = arg0
3042 rctx := graphql.GetResolverContext(ctx)
3043 rctx.Object = "__Type"
3044 rctx.Args = args
3045 rctx.Field = field
3046 rctx.PushField(field.Alias)
3047 defer rctx.Pop()
3048 res := obj.Fields(args["includeDeprecated"].(bool))
3049 arr1 := graphql.Array{}
3050 for idx1 := range res {
3051 arr1 = append(arr1, func() graphql.Marshaler {
3052 rctx := graphql.GetResolverContext(ctx)
3053 rctx.PushIndex(idx1)
3054 defer rctx.Pop()
3055 return ec.___Field(ctx, field.Selections, &res[idx1])
3056 }())
3057 }
3058 return arr1
3059}
3060
3061func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
3062 rctx := graphql.GetResolverContext(ctx)
3063 rctx.Object = "__Type"
3064 rctx.Args = nil
3065 rctx.Field = field
3066 rctx.PushField(field.Alias)
3067 defer rctx.Pop()
3068 res := obj.Interfaces()
3069 arr1 := graphql.Array{}
3070 for idx1 := range res {
3071 arr1 = append(arr1, func() graphql.Marshaler {
3072 rctx := graphql.GetResolverContext(ctx)
3073 rctx.PushIndex(idx1)
3074 defer rctx.Pop()
3075 return ec.___Type(ctx, field.Selections, &res[idx1])
3076 }())
3077 }
3078 return arr1
3079}
3080
3081func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
3082 rctx := graphql.GetResolverContext(ctx)
3083 rctx.Object = "__Type"
3084 rctx.Args = nil
3085 rctx.Field = field
3086 rctx.PushField(field.Alias)
3087 defer rctx.Pop()
3088 res := obj.PossibleTypes()
3089 arr1 := graphql.Array{}
3090 for idx1 := range res {
3091 arr1 = append(arr1, func() graphql.Marshaler {
3092 rctx := graphql.GetResolverContext(ctx)
3093 rctx.PushIndex(idx1)
3094 defer rctx.Pop()
3095 return ec.___Type(ctx, field.Selections, &res[idx1])
3096 }())
3097 }
3098 return arr1
3099}
3100
3101func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
3102 args := map[string]interface{}{}
3103 var arg0 bool
3104 if tmp, ok := field.Args["includeDeprecated"]; ok {
3105 var err error
3106 arg0, err = graphql.UnmarshalBoolean(tmp)
3107 if err != nil {
3108 ec.Error(ctx, err)
3109 return graphql.Null
3110 }
3111 }
3112 args["includeDeprecated"] = arg0
3113 rctx := graphql.GetResolverContext(ctx)
3114 rctx.Object = "__Type"
3115 rctx.Args = args
3116 rctx.Field = field
3117 rctx.PushField(field.Alias)
3118 defer rctx.Pop()
3119 res := obj.EnumValues(args["includeDeprecated"].(bool))
3120 arr1 := graphql.Array{}
3121 for idx1 := range res {
3122 arr1 = append(arr1, func() graphql.Marshaler {
3123 rctx := graphql.GetResolverContext(ctx)
3124 rctx.PushIndex(idx1)
3125 defer rctx.Pop()
3126 return ec.___EnumValue(ctx, field.Selections, &res[idx1])
3127 }())
3128 }
3129 return arr1
3130}
3131
3132func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
3133 rctx := graphql.GetResolverContext(ctx)
3134 rctx.Object = "__Type"
3135 rctx.Args = nil
3136 rctx.Field = field
3137 rctx.PushField(field.Alias)
3138 defer rctx.Pop()
3139 res := obj.InputFields()
3140 arr1 := graphql.Array{}
3141 for idx1 := range res {
3142 arr1 = append(arr1, func() graphql.Marshaler {
3143 rctx := graphql.GetResolverContext(ctx)
3144 rctx.PushIndex(idx1)
3145 defer rctx.Pop()
3146 return ec.___InputValue(ctx, field.Selections, &res[idx1])
3147 }())
3148 }
3149 return arr1
3150}
3151
3152func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
3153 rctx := graphql.GetResolverContext(ctx)
3154 rctx.Object = "__Type"
3155 rctx.Args = nil
3156 rctx.Field = field
3157 rctx.PushField(field.Alias)
3158 defer rctx.Pop()
3159 res := obj.OfType()
3160 if res == nil {
3161 return graphql.Null
3162 }
3163 return ec.___Type(ctx, field.Selections, res)
3164}
3165
3166func (ec *executionContext) _Authored(ctx context.Context, sel []query.Selection, obj *models.Authored) graphql.Marshaler {
3167 switch obj := (*obj).(type) {
3168 case nil:
3169 return graphql.Null
3170 case bug.Comment:
3171 return ec._Comment(ctx, sel, &obj)
3172 case *bug.Comment:
3173 return ec._Comment(ctx, sel, obj)
3174 case operations.CreateOperation:
3175 return ec._CreateOperation(ctx, sel, &obj)
3176 case *operations.CreateOperation:
3177 return ec._CreateOperation(ctx, sel, obj)
3178 case operations.SetTitleOperation:
3179 return ec._SetTitleOperation(ctx, sel, &obj)
3180 case *operations.SetTitleOperation:
3181 return ec._SetTitleOperation(ctx, sel, obj)
3182 case operations.AddCommentOperation:
3183 return ec._AddCommentOperation(ctx, sel, &obj)
3184 case *operations.AddCommentOperation:
3185 return ec._AddCommentOperation(ctx, sel, obj)
3186 case operations.SetStatusOperation:
3187 return ec._SetStatusOperation(ctx, sel, &obj)
3188 case *operations.SetStatusOperation:
3189 return ec._SetStatusOperation(ctx, sel, obj)
3190 case operations.LabelChangeOperation:
3191 return ec._LabelChangeOperation(ctx, sel, &obj)
3192 case *operations.LabelChangeOperation:
3193 return ec._LabelChangeOperation(ctx, sel, obj)
3194 default:
3195 panic(fmt.Errorf("unexpected type %T", obj))
3196 }
3197}
3198
3199func (ec *executionContext) _Operation(ctx context.Context, sel []query.Selection, obj *bug.Operation) graphql.Marshaler {
3200 switch obj := (*obj).(type) {
3201 case nil:
3202 return graphql.Null
3203 case operations.CreateOperation:
3204 return ec._CreateOperation(ctx, sel, &obj)
3205 case *operations.CreateOperation:
3206 return ec._CreateOperation(ctx, sel, obj)
3207 case operations.SetTitleOperation:
3208 return ec._SetTitleOperation(ctx, sel, &obj)
3209 case *operations.SetTitleOperation:
3210 return ec._SetTitleOperation(ctx, sel, obj)
3211 case operations.AddCommentOperation:
3212 return ec._AddCommentOperation(ctx, sel, &obj)
3213 case *operations.AddCommentOperation:
3214 return ec._AddCommentOperation(ctx, sel, obj)
3215 case operations.SetStatusOperation:
3216 return ec._SetStatusOperation(ctx, sel, &obj)
3217 case *operations.SetStatusOperation:
3218 return ec._SetStatusOperation(ctx, sel, obj)
3219 case operations.LabelChangeOperation:
3220 return ec._LabelChangeOperation(ctx, sel, &obj)
3221 case *operations.LabelChangeOperation:
3222 return ec._LabelChangeOperation(ctx, sel, obj)
3223 default:
3224 panic(fmt.Errorf("unexpected type %T", obj))
3225 }
3226}
3227
3228func (ec *executionContext) introspectSchema() *introspection.Schema {
3229 return introspection.WrapSchema(parsedSchema)
3230}
3231
3232func (ec *executionContext) introspectType(name string) *introspection.Type {
3233 t := parsedSchema.Resolve(name)
3234 if t == nil {
3235 return nil
3236 }
3237 return introspection.WrapType(t)
3238}
3239
3240var parsedSchema = schema.MustParse(`scalar Time
3241scalar Label
3242scalar Hash
3243
3244# Information about pagination in a connection.
3245type PageInfo {
3246 # When paginating forwards, are there more items?
3247 hasNextPage: Boolean!
3248 # When paginating backwards, are there more items?
3249 hasPreviousPage: Boolean!
3250 # When paginating backwards, the cursor to continue.
3251 startCursor: String!
3252 # When paginating forwards, the cursor to continue.
3253 endCursor: String!
3254}
3255
3256# Represents an person in a git object.
3257type Person {
3258 # The email of the person.
3259 email: String
3260
3261 # The name of the person.
3262 name: String
3263}
3264
3265type CommentConnection {
3266 edges: [CommentEdge!]!
3267 nodes: [Comment!]!
3268 pageInfo: PageInfo!
3269 totalCount: Int!
3270}
3271
3272type CommentEdge {
3273 cursor: String!
3274 node: Comment!
3275}
3276
3277# Represents a comment on a bug.
3278type Comment implements Authored {
3279 # The author of this comment.
3280 author: Person!
3281
3282 # The message of this comment.
3283 message: String!
3284
3285 # All media's hash referenced in this comment
3286 files: [Hash!]!
3287}
3288
3289enum Status {
3290 OPEN
3291 CLOSED
3292}
3293
3294# An object that has an author.
3295interface Authored {
3296 # The author of this object.
3297 author: Person!
3298}
3299
3300type OperationConnection {
3301 edges: [OperationEdge!]!
3302 nodes: [Operation!]!
3303 pageInfo: PageInfo!
3304 totalCount: Int!
3305}
3306
3307type OperationEdge {
3308 cursor: String!
3309 node: Operation!
3310}
3311
3312# An operation applied to a bug.
3313interface Operation {
3314 # The operations author.
3315 author: Person!
3316 # The datetime when this operation was issued.
3317 date: Time!
3318}
3319
3320type CreateOperation implements Operation, Authored {
3321 author: Person!
3322 date: Time!
3323
3324 title: String!
3325 message: String!
3326 files: [Hash!]!
3327}
3328
3329type SetTitleOperation implements Operation, Authored {
3330 author: Person!
3331 date: Time!
3332
3333 title: String!
3334}
3335
3336type AddCommentOperation implements Operation, Authored {
3337 author: Person!
3338 date: Time!
3339
3340 message: String!
3341 files: [Hash!]!
3342}
3343
3344type SetStatusOperation implements Operation, Authored {
3345 author: Person!
3346 date: Time!
3347
3348 status: Status!
3349}
3350
3351type LabelChangeOperation implements Operation, Authored {
3352 author: Person!
3353 date: Time!
3354
3355 added: [Label!]!
3356 removed: [Label!]!
3357}
3358
3359# The connection type for Bug.
3360type BugConnection {
3361 # A list of edges.
3362 edges: [BugEdge!]!
3363 nodes: [Bug!]!
3364 # Information to aid in pagination.
3365 pageInfo: PageInfo!
3366 # Identifies the total count of items in the connection.
3367 totalCount: Int!
3368}
3369
3370# An edge in a connection.
3371type BugEdge {
3372 # A cursor for use in pagination.
3373 cursor: String!
3374 # The item at the end of the edge.
3375 node: Bug!
3376}
3377
3378type Bug {
3379 id: String!
3380 humanId: String!
3381 status: Status!
3382 title: String!
3383 labels: [Label!]!
3384 author: Person!
3385 createdAt: Time!
3386 lastEdit: Time!
3387
3388 comments(
3389 # Returns the elements in the list that come after the specified cursor.
3390 after: String
3391 # Returns the elements in the list that come before the specified cursor.
3392 before: String
3393 # Returns the first _n_ elements from the list.
3394 first: Int
3395 # Returns the last _n_ elements from the list.
3396 last: Int
3397 ): CommentConnection!
3398
3399 operations(
3400 # Returns the elements in the list that come after the specified cursor.
3401 after: String
3402 # Returns the elements in the list that come before the specified cursor.
3403 before: String
3404 # Returns the first _n_ elements from the list.
3405 first: Int
3406 # Returns the last _n_ elements from the list.
3407 last: Int
3408 ): OperationConnection!
3409}
3410
3411type Repository {
3412 allBugs(
3413 # Returns the elements in the list that come after the specified cursor.
3414 after: String
3415 # Returns the elements in the list that come before the specified cursor.
3416 before: String
3417 # Returns the first _n_ elements from the list.
3418 first: Int
3419 # Returns the last _n_ elements from the list.
3420 last: Int
3421 ): BugConnection!
3422 bug(prefix: String!): Bug
3423}
3424
3425type Query {
3426 defaultRepository: Repository
3427 repository(id: String!): Repository
3428}
3429
3430type Mutation {
3431 newBug(repoRef: String, title: String!, message: String!, files: [Hash!]): Bug!
3432
3433 addComment(repoRef: String, prefix: String!, message: String!, files: [Hash!]): Bug!
3434 changeLabels(repoRef: String, prefix: String!, added: [String!], removed: [String!]): Bug!
3435 open(repoRef: String, prefix: String!): Bug!
3436 close(repoRef: String, prefix: String!): Bug!
3437 setTitle(repoRef: String, prefix: String!, title: String!): Bug!
3438
3439 commit(repoRef: String, prefix: String!): Bug!
3440}
3441`)