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