From b478cd1bcb4756b20f7f4b15fcf81f23e1a60a02 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Fri, 14 Sep 2018 12:40:31 +0200 Subject: graphql: update gqlgen to 0.5.1 fix #6 --- graphql/graph/gen_graph.go | 6080 ++++++++++++++++++++++++++++++-------------- 1 file changed, 4148 insertions(+), 1932 deletions(-) (limited to 'graphql/graph/gen_graph.go') diff --git a/graphql/graph/gen_graph.go b/graphql/graph/gen_graph.go index a3ea1738..9243d07a 100644 --- a/graphql/graph/gen_graph.go +++ b/graphql/graph/gen_graph.go @@ -1,4 +1,4 @@ -// Code generated by github.com/vektah/gqlgen, DO NOT EDIT. +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. package graph @@ -7,59 +7,32 @@ import ( context "context" fmt "fmt" strconv "strconv" + sync "sync" time "time" + graphql "github.com/99designs/gqlgen/graphql" + introspection "github.com/99designs/gqlgen/graphql/introspection" bug "github.com/MichaelMure/git-bug/bug" models "github.com/MichaelMure/git-bug/graphql/models" operations "github.com/MichaelMure/git-bug/operations" git "github.com/MichaelMure/git-bug/util/git" - graphql "github.com/vektah/gqlgen/graphql" - introspection "github.com/vektah/gqlgen/neelance/introspection" - query "github.com/vektah/gqlgen/neelance/query" - schema "github.com/vektah/gqlgen/neelance/schema" + gqlparser "github.com/vektah/gqlparser" + ast "github.com/vektah/gqlparser/ast" ) -// MakeExecutableSchema creates an ExecutableSchema from the Resolvers interface. -func MakeExecutableSchema(resolvers Resolvers) graphql.ExecutableSchema { - return &executableSchema{resolvers: resolvers} -} - // NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. -func NewExecutableSchema(resolvers ResolverRoot) graphql.ExecutableSchema { - return MakeExecutableSchema(shortMapper{r: resolvers}) +func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { + return &executableSchema{ + resolvers: cfg.Resolvers, + directives: cfg.Directives, + complexity: cfg.Complexity, + } } -type Resolvers interface { - AddCommentOperation_date(ctx context.Context, obj *operations.AddCommentOperation) (time.Time, error) - - Bug_status(ctx context.Context, obj *bug.Snapshot) (models.Status, error) - - Bug_lastEdit(ctx context.Context, obj *bug.Snapshot) (time.Time, error) - Bug_comments(ctx context.Context, obj *bug.Snapshot, after *string, before *string, first *int, last *int) (models.CommentConnection, error) - Bug_operations(ctx context.Context, obj *bug.Snapshot, after *string, before *string, first *int, last *int) (models.OperationConnection, error) - - CreateOperation_date(ctx context.Context, obj *operations.CreateOperation) (time.Time, error) - - LabelChangeOperation_date(ctx context.Context, obj *operations.LabelChangeOperation) (time.Time, error) - - Mutation_newBug(ctx context.Context, repoRef *string, title string, message string, files []git.Hash) (bug.Snapshot, error) - Mutation_addComment(ctx context.Context, repoRef *string, prefix string, message string, files []git.Hash) (bug.Snapshot, error) - Mutation_changeLabels(ctx context.Context, repoRef *string, prefix string, added []string, removed []string) (bug.Snapshot, error) - Mutation_open(ctx context.Context, repoRef *string, prefix string) (bug.Snapshot, error) - Mutation_close(ctx context.Context, repoRef *string, prefix string) (bug.Snapshot, error) - Mutation_setTitle(ctx context.Context, repoRef *string, prefix string, title string) (bug.Snapshot, error) - Mutation_commit(ctx context.Context, repoRef *string, prefix string) (bug.Snapshot, error) - - Query_defaultRepository(ctx context.Context) (*models.Repository, error) - Query_repository(ctx context.Context, id string) (*models.Repository, error) - - Repository_allBugs(ctx context.Context, obj *models.Repository, after *string, before *string, first *int, last *int, query *string) (models.BugConnection, error) - Repository_bug(ctx context.Context, obj *models.Repository, prefix string) (*bug.Snapshot, error) - - SetStatusOperation_date(ctx context.Context, obj *operations.SetStatusOperation) (time.Time, error) - SetStatusOperation_status(ctx context.Context, obj *operations.SetStatusOperation) (models.Status, error) - - SetTitleOperation_date(ctx context.Context, obj *operations.SetTitleOperation) (time.Time, error) +type Config struct { + Resolvers ResolverRoot + Directives DirectiveRoot + Complexity ComplexityRoot } type ResolverRoot interface { @@ -73,6 +46,134 @@ type ResolverRoot interface { SetStatusOperation() SetStatusOperationResolver SetTitleOperation() SetTitleOperationResolver } + +type DirectiveRoot struct { +} + +type ComplexityRoot struct { + AddCommentOperation struct { + Author func(childComplexity int) int + Date func(childComplexity int) int + Message func(childComplexity int) int + Files func(childComplexity int) int + } + + Bug struct { + Id func(childComplexity int) int + HumanId func(childComplexity int) int + Status func(childComplexity int) int + Title func(childComplexity int) int + Labels func(childComplexity int) int + Author func(childComplexity int) int + CreatedAt func(childComplexity int) int + LastEdit func(childComplexity int) int + Comments func(childComplexity int, after *string, before *string, first *int, last *int) int + Operations func(childComplexity int, after *string, before *string, first *int, last *int) int + } + + BugConnection struct { + Edges func(childComplexity int) int + Nodes func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + BugEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + Comment struct { + Author func(childComplexity int) int + Message func(childComplexity int) int + Files func(childComplexity int) int + } + + CommentConnection struct { + Edges func(childComplexity int) int + Nodes func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + CommentEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + CreateOperation struct { + Author func(childComplexity int) int + Date func(childComplexity int) int + Title func(childComplexity int) int + Message func(childComplexity int) int + Files func(childComplexity int) int + } + + LabelChangeOperation struct { + Author func(childComplexity int) int + Date func(childComplexity int) int + Added func(childComplexity int) int + Removed func(childComplexity int) int + } + + Mutation struct { + NewBug func(childComplexity int, repoRef *string, title string, message string, files []git.Hash) int + AddComment func(childComplexity int, repoRef *string, prefix string, message string, files []git.Hash) int + ChangeLabels func(childComplexity int, repoRef *string, prefix string, added []string, removed []string) int + Open func(childComplexity int, repoRef *string, prefix string) int + Close func(childComplexity int, repoRef *string, prefix string) int + SetTitle func(childComplexity int, repoRef *string, prefix string, title string) int + Commit func(childComplexity int, repoRef *string, prefix string) int + } + + OperationConnection struct { + Edges func(childComplexity int) int + Nodes func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + OperationEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + PageInfo struct { + HasNextPage func(childComplexity int) int + HasPreviousPage func(childComplexity int) int + StartCursor func(childComplexity int) int + EndCursor func(childComplexity int) int + } + + Person struct { + Email func(childComplexity int) int + Name func(childComplexity int) int + } + + Query struct { + DefaultRepository func(childComplexity int) int + Repository func(childComplexity int, id string) int + } + + Repository struct { + AllBugs func(childComplexity int, after *string, before *string, first *int, last *int, query *string) int + Bug func(childComplexity int, prefix string) int + } + + SetStatusOperation struct { + Author func(childComplexity int) int + Date func(childComplexity int) int + Status func(childComplexity int) int + } + + SetTitleOperation struct { + Author func(childComplexity int) int + Date func(childComplexity int) int + Title func(childComplexity int) int + Was func(childComplexity int) int + } +} + type AddCommentOperationResolver interface { Date(ctx context.Context, obj *operations.AddCommentOperation) (time.Time, error) } @@ -114,107 +215,1149 @@ type SetTitleOperationResolver interface { Date(ctx context.Context, obj *operations.SetTitleOperation) (time.Time, error) } -type shortMapper struct { - r ResolverRoot -} +func field_Bug_comments_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { + args := map[string]interface{}{} + var arg0 *string + if tmp, ok := rawArgs["after"]; ok { + var err error + var ptr1 string + if tmp != nil { + ptr1, err = graphql.UnmarshalString(tmp) + arg0 = &ptr1 + } -func (s shortMapper) AddCommentOperation_date(ctx context.Context, obj *operations.AddCommentOperation) (time.Time, error) { - return s.r.AddCommentOperation().Date(ctx, obj) -} + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *string + if tmp, ok := rawArgs["before"]; ok { + var err error + var ptr1 string + if tmp != nil { + ptr1, err = graphql.UnmarshalString(tmp) + arg1 = &ptr1 + } -func (s shortMapper) Bug_status(ctx context.Context, obj *bug.Snapshot) (models.Status, error) { - return s.r.Bug().Status(ctx, obj) -} + if err != nil { + return nil, err + } + } + args["before"] = arg1 + var arg2 *int + if tmp, ok := rawArgs["first"]; ok { + var err error + var ptr1 int + if tmp != nil { + ptr1, err = graphql.UnmarshalInt(tmp) + arg2 = &ptr1 + } -func (s shortMapper) Bug_lastEdit(ctx context.Context, obj *bug.Snapshot) (time.Time, error) { - return s.r.Bug().LastEdit(ctx, obj) -} + if err != nil { + return nil, err + } + } + args["first"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + var err error + var ptr1 int + if tmp != nil { + ptr1, err = graphql.UnmarshalInt(tmp) + arg3 = &ptr1 + } -func (s shortMapper) Bug_comments(ctx context.Context, obj *bug.Snapshot, after *string, before *string, first *int, last *int) (models.CommentConnection, error) { - return s.r.Bug().Comments(ctx, obj, after, before, first, last) -} + if err != nil { + return nil, err + } + } + args["last"] = arg3 + return args, nil -func (s shortMapper) Bug_operations(ctx context.Context, obj *bug.Snapshot, after *string, before *string, first *int, last *int) (models.OperationConnection, error) { - return s.r.Bug().Operations(ctx, obj, after, before, first, last) } -func (s shortMapper) CreateOperation_date(ctx context.Context, obj *operations.CreateOperation) (time.Time, error) { - return s.r.CreateOperation().Date(ctx, obj) -} +func field_Bug_operations_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { + args := map[string]interface{}{} + var arg0 *string + if tmp, ok := rawArgs["after"]; ok { + var err error + var ptr1 string + if tmp != nil { + ptr1, err = graphql.UnmarshalString(tmp) + arg0 = &ptr1 + } -func (s shortMapper) LabelChangeOperation_date(ctx context.Context, obj *operations.LabelChangeOperation) (time.Time, error) { - return s.r.LabelChangeOperation().Date(ctx, obj) -} + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *string + if tmp, ok := rawArgs["before"]; ok { + var err error + var ptr1 string + if tmp != nil { + ptr1, err = graphql.UnmarshalString(tmp) + arg1 = &ptr1 + } -func (s shortMapper) Mutation_newBug(ctx context.Context, repoRef *string, title string, message string, files []git.Hash) (bug.Snapshot, error) { - return s.r.Mutation().NewBug(ctx, repoRef, title, message, files) -} + if err != nil { + return nil, err + } + } + args["before"] = arg1 + var arg2 *int + if tmp, ok := rawArgs["first"]; ok { + var err error + var ptr1 int + if tmp != nil { + ptr1, err = graphql.UnmarshalInt(tmp) + arg2 = &ptr1 + } -func (s shortMapper) Mutation_addComment(ctx context.Context, repoRef *string, prefix string, message string, files []git.Hash) (bug.Snapshot, error) { - return s.r.Mutation().AddComment(ctx, repoRef, prefix, message, files) -} + if err != nil { + return nil, err + } + } + args["first"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + var err error + var ptr1 int + if tmp != nil { + ptr1, err = graphql.UnmarshalInt(tmp) + arg3 = &ptr1 + } -func (s shortMapper) Mutation_changeLabels(ctx context.Context, repoRef *string, prefix string, added []string, removed []string) (bug.Snapshot, error) { - return s.r.Mutation().ChangeLabels(ctx, repoRef, prefix, added, removed) -} + if err != nil { + return nil, err + } + } + args["last"] = arg3 + return args, nil -func (s shortMapper) Mutation_open(ctx context.Context, repoRef *string, prefix string) (bug.Snapshot, error) { - return s.r.Mutation().Open(ctx, repoRef, prefix) } -func (s shortMapper) Mutation_close(ctx context.Context, repoRef *string, prefix string) (bug.Snapshot, error) { - return s.r.Mutation().Close(ctx, repoRef, prefix) -} +func field_Mutation_newBug_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { + args := map[string]interface{}{} + var arg0 *string + if tmp, ok := rawArgs["repoRef"]; ok { + var err error + var ptr1 string + if tmp != nil { + ptr1, err = graphql.UnmarshalString(tmp) + arg0 = &ptr1 + } -func (s shortMapper) Mutation_setTitle(ctx context.Context, repoRef *string, prefix string, title string) (bug.Snapshot, error) { - return s.r.Mutation().SetTitle(ctx, repoRef, prefix, title) -} + if err != nil { + return nil, err + } + } + args["repoRef"] = arg0 + var arg1 string + if tmp, ok := rawArgs["title"]; ok { + var err error + arg1, err = graphql.UnmarshalString(tmp) + if err != nil { + return nil, err + } + } + args["title"] = arg1 + var arg2 string + if tmp, ok := rawArgs["message"]; ok { + var err error + arg2, err = graphql.UnmarshalString(tmp) + if err != nil { + return nil, err + } + } + args["message"] = arg2 + var arg3 []git.Hash + if tmp, ok := rawArgs["files"]; ok { + var err error + var rawIf1 []interface{} + if tmp != nil { + if tmp1, ok := tmp.([]interface{}); ok { + rawIf1 = tmp1 + } else { + rawIf1 = []interface{}{tmp} + } + } + arg3 = make([]git.Hash, len(rawIf1)) + for idx1 := range rawIf1 { + err = (&arg3[idx1]).UnmarshalGQL(rawIf1[idx1]) + } + if err != nil { + return nil, err + } + } + args["files"] = arg3 + return args, nil -func (s shortMapper) Mutation_commit(ctx context.Context, repoRef *string, prefix string) (bug.Snapshot, error) { - return s.r.Mutation().Commit(ctx, repoRef, prefix) } -func (s shortMapper) Query_defaultRepository(ctx context.Context) (*models.Repository, error) { - return s.r.Query().DefaultRepository(ctx) -} +func field_Mutation_addComment_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { + args := map[string]interface{}{} + var arg0 *string + if tmp, ok := rawArgs["repoRef"]; ok { + var err error + var ptr1 string + if tmp != nil { + ptr1, err = graphql.UnmarshalString(tmp) + arg0 = &ptr1 + } -func (s shortMapper) Query_repository(ctx context.Context, id string) (*models.Repository, error) { - return s.r.Query().Repository(ctx, id) -} + if err != nil { + return nil, err + } + } + args["repoRef"] = arg0 + var arg1 string + if tmp, ok := rawArgs["prefix"]; ok { + var err error + arg1, err = graphql.UnmarshalString(tmp) + if err != nil { + return nil, err + } + } + args["prefix"] = arg1 + var arg2 string + if tmp, ok := rawArgs["message"]; ok { + var err error + arg2, err = graphql.UnmarshalString(tmp) + if err != nil { + return nil, err + } + } + args["message"] = arg2 + var arg3 []git.Hash + if tmp, ok := rawArgs["files"]; ok { + var err error + var rawIf1 []interface{} + if tmp != nil { + if tmp1, ok := tmp.([]interface{}); ok { + rawIf1 = tmp1 + } else { + rawIf1 = []interface{}{tmp} + } + } + arg3 = make([]git.Hash, len(rawIf1)) + for idx1 := range rawIf1 { + err = (&arg3[idx1]).UnmarshalGQL(rawIf1[idx1]) + } + if err != nil { + return nil, err + } + } + args["files"] = arg3 + return args, nil -func (s shortMapper) Repository_allBugs(ctx context.Context, obj *models.Repository, after *string, before *string, first *int, last *int, query *string) (models.BugConnection, error) { - return s.r.Repository().AllBugs(ctx, obj, after, before, first, last, query) } -func (s shortMapper) Repository_bug(ctx context.Context, obj *models.Repository, prefix string) (*bug.Snapshot, error) { - return s.r.Repository().Bug(ctx, obj, prefix) -} +func field_Mutation_changeLabels_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { + args := map[string]interface{}{} + var arg0 *string + if tmp, ok := rawArgs["repoRef"]; ok { + var err error + var ptr1 string + if tmp != nil { + ptr1, err = graphql.UnmarshalString(tmp) + arg0 = &ptr1 + } -func (s shortMapper) SetStatusOperation_date(ctx context.Context, obj *operations.SetStatusOperation) (time.Time, error) { - return s.r.SetStatusOperation().Date(ctx, obj) -} + if err != nil { + return nil, err + } + } + args["repoRef"] = arg0 + var arg1 string + if tmp, ok := rawArgs["prefix"]; ok { + var err error + arg1, err = graphql.UnmarshalString(tmp) + if err != nil { + return nil, err + } + } + args["prefix"] = arg1 + var arg2 []string + if tmp, ok := rawArgs["added"]; ok { + var err error + var rawIf1 []interface{} + if tmp != nil { + if tmp1, ok := tmp.([]interface{}); ok { + rawIf1 = tmp1 + } else { + rawIf1 = []interface{}{tmp} + } + } + arg2 = make([]string, len(rawIf1)) + for idx1 := range rawIf1 { + arg2[idx1], err = graphql.UnmarshalString(rawIf1[idx1]) + } + if err != nil { + return nil, err + } + } + args["added"] = arg2 + var arg3 []string + if tmp, ok := rawArgs["removed"]; ok { + var err error + var rawIf1 []interface{} + if tmp != nil { + if tmp1, ok := tmp.([]interface{}); ok { + rawIf1 = tmp1 + } else { + rawIf1 = []interface{}{tmp} + } + } + arg3 = make([]string, len(rawIf1)) + for idx1 := range rawIf1 { + arg3[idx1], err = graphql.UnmarshalString(rawIf1[idx1]) + } + if err != nil { + return nil, err + } + } + args["removed"] = arg3 + return args, nil + +} + +func field_Mutation_open_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { + args := map[string]interface{}{} + var arg0 *string + if tmp, ok := rawArgs["repoRef"]; ok { + var err error + var ptr1 string + if tmp != nil { + ptr1, err = graphql.UnmarshalString(tmp) + arg0 = &ptr1 + } + + if err != nil { + return nil, err + } + } + args["repoRef"] = arg0 + var arg1 string + if tmp, ok := rawArgs["prefix"]; ok { + var err error + arg1, err = graphql.UnmarshalString(tmp) + if err != nil { + return nil, err + } + } + args["prefix"] = arg1 + return args, nil + +} + +func field_Mutation_close_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { + args := map[string]interface{}{} + var arg0 *string + if tmp, ok := rawArgs["repoRef"]; ok { + var err error + var ptr1 string + if tmp != nil { + ptr1, err = graphql.UnmarshalString(tmp) + arg0 = &ptr1 + } + + if err != nil { + return nil, err + } + } + args["repoRef"] = arg0 + var arg1 string + if tmp, ok := rawArgs["prefix"]; ok { + var err error + arg1, err = graphql.UnmarshalString(tmp) + if err != nil { + return nil, err + } + } + args["prefix"] = arg1 + return args, nil + +} + +func field_Mutation_setTitle_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { + args := map[string]interface{}{} + var arg0 *string + if tmp, ok := rawArgs["repoRef"]; ok { + var err error + var ptr1 string + if tmp != nil { + ptr1, err = graphql.UnmarshalString(tmp) + arg0 = &ptr1 + } + + if err != nil { + return nil, err + } + } + args["repoRef"] = arg0 + var arg1 string + if tmp, ok := rawArgs["prefix"]; ok { + var err error + arg1, err = graphql.UnmarshalString(tmp) + if err != nil { + return nil, err + } + } + args["prefix"] = arg1 + var arg2 string + if tmp, ok := rawArgs["title"]; ok { + var err error + arg2, err = graphql.UnmarshalString(tmp) + if err != nil { + return nil, err + } + } + args["title"] = arg2 + return args, nil + +} + +func field_Mutation_commit_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { + args := map[string]interface{}{} + var arg0 *string + if tmp, ok := rawArgs["repoRef"]; ok { + var err error + var ptr1 string + if tmp != nil { + ptr1, err = graphql.UnmarshalString(tmp) + arg0 = &ptr1 + } + + if err != nil { + return nil, err + } + } + args["repoRef"] = arg0 + var arg1 string + if tmp, ok := rawArgs["prefix"]; ok { + var err error + arg1, err = graphql.UnmarshalString(tmp) + if err != nil { + return nil, err + } + } + args["prefix"] = arg1 + return args, nil + +} + +func field_Query_repository_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + var err error + arg0, err = graphql.UnmarshalString(tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil + +} + +func field_Query___type_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["name"]; ok { + var err error + arg0, err = graphql.UnmarshalString(tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg0 + return args, nil + +} + +func field_Repository_allBugs_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { + args := map[string]interface{}{} + var arg0 *string + if tmp, ok := rawArgs["after"]; ok { + var err error + var ptr1 string + if tmp != nil { + ptr1, err = graphql.UnmarshalString(tmp) + arg0 = &ptr1 + } + + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *string + if tmp, ok := rawArgs["before"]; ok { + var err error + var ptr1 string + if tmp != nil { + ptr1, err = graphql.UnmarshalString(tmp) + arg1 = &ptr1 + } + + if err != nil { + return nil, err + } + } + args["before"] = arg1 + var arg2 *int + if tmp, ok := rawArgs["first"]; ok { + var err error + var ptr1 int + if tmp != nil { + ptr1, err = graphql.UnmarshalInt(tmp) + arg2 = &ptr1 + } + + if err != nil { + return nil, err + } + } + args["first"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + var err error + var ptr1 int + if tmp != nil { + ptr1, err = graphql.UnmarshalInt(tmp) + arg3 = &ptr1 + } + + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *string + if tmp, ok := rawArgs["query"]; ok { + var err error + var ptr1 string + if tmp != nil { + ptr1, err = graphql.UnmarshalString(tmp) + arg4 = &ptr1 + } + + if err != nil { + return nil, err + } + } + args["query"] = arg4 + return args, nil + +} + +func field_Repository_bug_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["prefix"]; ok { + var err error + arg0, err = graphql.UnmarshalString(tmp) + if err != nil { + return nil, err + } + } + args["prefix"] = arg0 + return args, nil + +} + +func field___Type_fields_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { + args := map[string]interface{}{} + var arg0 bool + if tmp, ok := rawArgs["includeDeprecated"]; ok { + var err error + arg0, err = graphql.UnmarshalBoolean(tmp) + if err != nil { + return nil, err + } + } + args["includeDeprecated"] = arg0 + return args, nil + +} + +func field___Type_enumValues_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { + args := map[string]interface{}{} + var arg0 bool + if tmp, ok := rawArgs["includeDeprecated"]; ok { + var err error + arg0, err = graphql.UnmarshalBoolean(tmp) + if err != nil { + return nil, err + } + } + args["includeDeprecated"] = arg0 + return args, nil + +} + +type executableSchema struct { + resolvers ResolverRoot + directives DirectiveRoot + complexity ComplexityRoot +} + +func (e *executableSchema) Schema() *ast.Schema { + return parsedSchema +} + +func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) { + switch typeName + "." + field { + + case "AddCommentOperation.author": + if e.complexity.AddCommentOperation.Author == nil { + break + } + + return e.complexity.AddCommentOperation.Author(childComplexity), true + + case "AddCommentOperation.date": + if e.complexity.AddCommentOperation.Date == nil { + break + } + + return e.complexity.AddCommentOperation.Date(childComplexity), true + + case "AddCommentOperation.message": + if e.complexity.AddCommentOperation.Message == nil { + break + } + + return e.complexity.AddCommentOperation.Message(childComplexity), true + + case "AddCommentOperation.files": + if e.complexity.AddCommentOperation.Files == nil { + break + } + + return e.complexity.AddCommentOperation.Files(childComplexity), true + + case "Bug.id": + if e.complexity.Bug.Id == nil { + break + } + + return e.complexity.Bug.Id(childComplexity), true + + case "Bug.humanId": + if e.complexity.Bug.HumanId == nil { + break + } + + return e.complexity.Bug.HumanId(childComplexity), true + + case "Bug.status": + if e.complexity.Bug.Status == nil { + break + } + + return e.complexity.Bug.Status(childComplexity), true + + case "Bug.title": + if e.complexity.Bug.Title == nil { + break + } + + return e.complexity.Bug.Title(childComplexity), true + + case "Bug.labels": + if e.complexity.Bug.Labels == nil { + break + } + + return e.complexity.Bug.Labels(childComplexity), true + + case "Bug.author": + if e.complexity.Bug.Author == nil { + break + } + + return e.complexity.Bug.Author(childComplexity), true + + case "Bug.createdAt": + if e.complexity.Bug.CreatedAt == nil { + break + } + + return e.complexity.Bug.CreatedAt(childComplexity), true + + case "Bug.lastEdit": + if e.complexity.Bug.LastEdit == nil { + break + } + + return e.complexity.Bug.LastEdit(childComplexity), true + + case "Bug.comments": + if e.complexity.Bug.Comments == nil { + break + } + + args, err := field_Bug_comments_args(rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Bug.Comments(childComplexity, args["after"].(*string), args["before"].(*string), args["first"].(*int), args["last"].(*int)), true + + case "Bug.operations": + if e.complexity.Bug.Operations == nil { + break + } + + args, err := field_Bug_operations_args(rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Bug.Operations(childComplexity, args["after"].(*string), args["before"].(*string), args["first"].(*int), args["last"].(*int)), true + + case "BugConnection.edges": + if e.complexity.BugConnection.Edges == nil { + break + } + + return e.complexity.BugConnection.Edges(childComplexity), true + + case "BugConnection.nodes": + if e.complexity.BugConnection.Nodes == nil { + break + } + + return e.complexity.BugConnection.Nodes(childComplexity), true + + case "BugConnection.pageInfo": + if e.complexity.BugConnection.PageInfo == nil { + break + } + + return e.complexity.BugConnection.PageInfo(childComplexity), true + + case "BugConnection.totalCount": + if e.complexity.BugConnection.TotalCount == nil { + break + } + + return e.complexity.BugConnection.TotalCount(childComplexity), true + + case "BugEdge.cursor": + if e.complexity.BugEdge.Cursor == nil { + break + } + + return e.complexity.BugEdge.Cursor(childComplexity), true + + case "BugEdge.node": + if e.complexity.BugEdge.Node == nil { + break + } + + return e.complexity.BugEdge.Node(childComplexity), true + + case "Comment.author": + if e.complexity.Comment.Author == nil { + break + } + + return e.complexity.Comment.Author(childComplexity), true + + case "Comment.message": + if e.complexity.Comment.Message == nil { + break + } + + return e.complexity.Comment.Message(childComplexity), true + + case "Comment.files": + if e.complexity.Comment.Files == nil { + break + } + + return e.complexity.Comment.Files(childComplexity), true + + case "CommentConnection.edges": + if e.complexity.CommentConnection.Edges == nil { + break + } + + return e.complexity.CommentConnection.Edges(childComplexity), true + + case "CommentConnection.nodes": + if e.complexity.CommentConnection.Nodes == nil { + break + } + + return e.complexity.CommentConnection.Nodes(childComplexity), true + + case "CommentConnection.pageInfo": + if e.complexity.CommentConnection.PageInfo == nil { + break + } + + return e.complexity.CommentConnection.PageInfo(childComplexity), true + + case "CommentConnection.totalCount": + if e.complexity.CommentConnection.TotalCount == nil { + break + } + + return e.complexity.CommentConnection.TotalCount(childComplexity), true + + case "CommentEdge.cursor": + if e.complexity.CommentEdge.Cursor == nil { + break + } + + return e.complexity.CommentEdge.Cursor(childComplexity), true + + case "CommentEdge.node": + if e.complexity.CommentEdge.Node == nil { + break + } + + return e.complexity.CommentEdge.Node(childComplexity), true + + case "CreateOperation.author": + if e.complexity.CreateOperation.Author == nil { + break + } + + return e.complexity.CreateOperation.Author(childComplexity), true + + case "CreateOperation.date": + if e.complexity.CreateOperation.Date == nil { + break + } + + return e.complexity.CreateOperation.Date(childComplexity), true + + case "CreateOperation.title": + if e.complexity.CreateOperation.Title == nil { + break + } + + return e.complexity.CreateOperation.Title(childComplexity), true + + case "CreateOperation.message": + if e.complexity.CreateOperation.Message == nil { + break + } + + return e.complexity.CreateOperation.Message(childComplexity), true + + case "CreateOperation.files": + if e.complexity.CreateOperation.Files == nil { + break + } + + return e.complexity.CreateOperation.Files(childComplexity), true + + case "LabelChangeOperation.author": + if e.complexity.LabelChangeOperation.Author == nil { + break + } + + return e.complexity.LabelChangeOperation.Author(childComplexity), true + + case "LabelChangeOperation.date": + if e.complexity.LabelChangeOperation.Date == nil { + break + } + + return e.complexity.LabelChangeOperation.Date(childComplexity), true + + case "LabelChangeOperation.added": + if e.complexity.LabelChangeOperation.Added == nil { + break + } + + return e.complexity.LabelChangeOperation.Added(childComplexity), true + + case "LabelChangeOperation.removed": + if e.complexity.LabelChangeOperation.Removed == nil { + break + } + + return e.complexity.LabelChangeOperation.Removed(childComplexity), true + + case "Mutation.newBug": + if e.complexity.Mutation.NewBug == nil { + break + } + + args, err := field_Mutation_newBug_args(rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.NewBug(childComplexity, args["repoRef"].(*string), args["title"].(string), args["message"].(string), args["files"].([]git.Hash)), true + + case "Mutation.addComment": + if e.complexity.Mutation.AddComment == nil { + break + } + + args, err := field_Mutation_addComment_args(rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.AddComment(childComplexity, args["repoRef"].(*string), args["prefix"].(string), args["message"].(string), args["files"].([]git.Hash)), true + + case "Mutation.changeLabels": + if e.complexity.Mutation.ChangeLabels == nil { + break + } + + args, err := field_Mutation_changeLabels_args(rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.ChangeLabels(childComplexity, args["repoRef"].(*string), args["prefix"].(string), args["added"].([]string), args["removed"].([]string)), true + + case "Mutation.open": + if e.complexity.Mutation.Open == nil { + break + } + + args, err := field_Mutation_open_args(rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.Open(childComplexity, args["repoRef"].(*string), args["prefix"].(string)), true + + case "Mutation.close": + if e.complexity.Mutation.Close == nil { + break + } + + args, err := field_Mutation_close_args(rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.Close(childComplexity, args["repoRef"].(*string), args["prefix"].(string)), true + + case "Mutation.setTitle": + if e.complexity.Mutation.SetTitle == nil { + break + } + + args, err := field_Mutation_setTitle_args(rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.SetTitle(childComplexity, args["repoRef"].(*string), args["prefix"].(string), args["title"].(string)), true + + case "Mutation.commit": + if e.complexity.Mutation.Commit == nil { + break + } + + args, err := field_Mutation_commit_args(rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.Commit(childComplexity, args["repoRef"].(*string), args["prefix"].(string)), true + + case "OperationConnection.edges": + if e.complexity.OperationConnection.Edges == nil { + break + } + + return e.complexity.OperationConnection.Edges(childComplexity), true + + case "OperationConnection.nodes": + if e.complexity.OperationConnection.Nodes == nil { + break + } + + return e.complexity.OperationConnection.Nodes(childComplexity), true + + case "OperationConnection.pageInfo": + if e.complexity.OperationConnection.PageInfo == nil { + break + } + + return e.complexity.OperationConnection.PageInfo(childComplexity), true + + case "OperationConnection.totalCount": + if e.complexity.OperationConnection.TotalCount == nil { + break + } + + return e.complexity.OperationConnection.TotalCount(childComplexity), true + + case "OperationEdge.cursor": + if e.complexity.OperationEdge.Cursor == nil { + break + } + + return e.complexity.OperationEdge.Cursor(childComplexity), true + + case "OperationEdge.node": + if e.complexity.OperationEdge.Node == nil { + break + } + + return e.complexity.OperationEdge.Node(childComplexity), true + + case "PageInfo.hasNextPage": + if e.complexity.PageInfo.HasNextPage == nil { + break + } + + return e.complexity.PageInfo.HasNextPage(childComplexity), true + + case "PageInfo.hasPreviousPage": + if e.complexity.PageInfo.HasPreviousPage == nil { + break + } + + return e.complexity.PageInfo.HasPreviousPage(childComplexity), true + + case "PageInfo.startCursor": + if e.complexity.PageInfo.StartCursor == nil { + break + } + + return e.complexity.PageInfo.StartCursor(childComplexity), true + + case "PageInfo.endCursor": + if e.complexity.PageInfo.EndCursor == nil { + break + } + + return e.complexity.PageInfo.EndCursor(childComplexity), true + + case "Person.email": + if e.complexity.Person.Email == nil { + break + } + + return e.complexity.Person.Email(childComplexity), true + + case "Person.name": + if e.complexity.Person.Name == nil { + break + } + + return e.complexity.Person.Name(childComplexity), true + + case "Query.defaultRepository": + if e.complexity.Query.DefaultRepository == nil { + break + } + + return e.complexity.Query.DefaultRepository(childComplexity), true + + case "Query.repository": + if e.complexity.Query.Repository == nil { + break + } + + args, err := field_Query_repository_args(rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Repository(childComplexity, args["id"].(string)), true + + case "Repository.allBugs": + if e.complexity.Repository.AllBugs == nil { + break + } + + args, err := field_Repository_allBugs_args(rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Repository.AllBugs(childComplexity, args["after"].(*string), args["before"].(*string), args["first"].(*int), args["last"].(*int), args["query"].(*string)), true + + case "Repository.bug": + if e.complexity.Repository.Bug == nil { + break + } + + args, err := field_Repository_bug_args(rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Repository.Bug(childComplexity, args["prefix"].(string)), true + + case "SetStatusOperation.author": + if e.complexity.SetStatusOperation.Author == nil { + break + } + + return e.complexity.SetStatusOperation.Author(childComplexity), true + + case "SetStatusOperation.date": + if e.complexity.SetStatusOperation.Date == nil { + break + } + + return e.complexity.SetStatusOperation.Date(childComplexity), true + + case "SetStatusOperation.status": + if e.complexity.SetStatusOperation.Status == nil { + break + } + + return e.complexity.SetStatusOperation.Status(childComplexity), true + + case "SetTitleOperation.author": + if e.complexity.SetTitleOperation.Author == nil { + break + } + + return e.complexity.SetTitleOperation.Author(childComplexity), true + + case "SetTitleOperation.date": + if e.complexity.SetTitleOperation.Date == nil { + break + } + + return e.complexity.SetTitleOperation.Date(childComplexity), true + + case "SetTitleOperation.title": + if e.complexity.SetTitleOperation.Title == nil { + break + } -func (s shortMapper) SetStatusOperation_status(ctx context.Context, obj *operations.SetStatusOperation) (models.Status, error) { - return s.r.SetStatusOperation().Status(ctx, obj) -} + return e.complexity.SetTitleOperation.Title(childComplexity), true -func (s shortMapper) SetTitleOperation_date(ctx context.Context, obj *operations.SetTitleOperation) (time.Time, error) { - return s.r.SetTitleOperation().Date(ctx, obj) -} + case "SetTitleOperation.was": + if e.complexity.SetTitleOperation.Was == nil { + break + } -type executableSchema struct { - resolvers Resolvers -} + return e.complexity.SetTitleOperation.Was(childComplexity), true -func (e *executableSchema) Schema() *schema.Schema { - return parsedSchema + } + return 0, false } -func (e *executableSchema) Query(ctx context.Context, op *query.Operation) *graphql.Response { - ec := executionContext{graphql.GetRequestContext(ctx), e.resolvers} +func (e *executableSchema) Query(ctx context.Context, op *ast.OperationDefinition) *graphql.Response { + ec := executionContext{graphql.GetRequestContext(ctx), e} buf := ec.RequestMiddleware(ctx, func(ctx context.Context) []byte { - data := ec._Query(ctx, op.Selections) + data := ec._Query(ctx, op.SelectionSet) var buf bytes.Buffer data.MarshalGQL(&buf) return buf.Bytes() @@ -226,11 +1369,11 @@ func (e *executableSchema) Query(ctx context.Context, op *query.Operation) *grap } } -func (e *executableSchema) Mutation(ctx context.Context, op *query.Operation) *graphql.Response { - ec := executionContext{graphql.GetRequestContext(ctx), e.resolvers} +func (e *executableSchema) Mutation(ctx context.Context, op *ast.OperationDefinition) *graphql.Response { + ec := executionContext{graphql.GetRequestContext(ctx), e} buf := ec.RequestMiddleware(ctx, func(ctx context.Context) []byte { - data := ec._Mutation(ctx, op.Selections) + data := ec._Mutation(ctx, op.SelectionSet) var buf bytes.Buffer data.MarshalGQL(&buf) return buf.Bytes() @@ -242,23 +1385,24 @@ func (e *executableSchema) Mutation(ctx context.Context, op *query.Operation) *g } } -func (e *executableSchema) Subscription(ctx context.Context, op *query.Operation) func() *graphql.Response { +func (e *executableSchema) Subscription(ctx context.Context, op *ast.OperationDefinition) func() *graphql.Response { return graphql.OneShot(graphql.ErrorResponse(ctx, "subscriptions are not supported")) } type executionContext struct { *graphql.RequestContext - - resolvers Resolvers + *executableSchema } var addCommentOperationImplementors = []string{"AddCommentOperation", "Operation", "Authored"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _AddCommentOperation(ctx context.Context, sel []query.Selection, obj *operations.AddCommentOperation) graphql.Marshaler { - fields := graphql.CollectFields(ec.Doc, sel, addCommentOperationImplementors, ec.Variables) +func (ec *executionContext) _AddCommentOperation(ctx context.Context, sel ast.SelectionSet, obj *operations.AddCommentOperation) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, addCommentOperationImplementors) + var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) + invalid := false for i, field := range fields { out.Keys[i] = field.Alias @@ -267,99 +1411,146 @@ func (ec *executionContext) _AddCommentOperation(ctx context.Context, sel []quer out.Values[i] = graphql.MarshalString("AddCommentOperation") case "author": out.Values[i] = ec._AddCommentOperation_author(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "date": - out.Values[i] = ec._AddCommentOperation_date(ctx, field, obj) + wg.Add(1) + go func(i int, field graphql.CollectedField) { + out.Values[i] = ec._AddCommentOperation_date(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + wg.Done() + }(i, field) case "message": out.Values[i] = ec._AddCommentOperation_message(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "files": out.Values[i] = ec._AddCommentOperation_files(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } default: panic("unknown field " + strconv.Quote(field.Name)) } } - + wg.Wait() + if invalid { + return graphql.Null + } return out } +// nolint: vetshadow func (ec *executionContext) _AddCommentOperation_author(ctx context.Context, field graphql.CollectedField, obj *operations.AddCommentOperation) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "AddCommentOperation" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Author + rctx := &graphql.ResolverContext{ + Object: "AddCommentOperation", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Author, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bug.Person) + rctx.Result = res + return ec._Person(ctx, field.Selections, &res) } +// nolint: vetshadow func (ec *executionContext) _AddCommentOperation_date(ctx context.Context, field graphql.CollectedField, obj *operations.AddCommentOperation) graphql.Marshaler { - ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ + rctx := &graphql.ResolverContext{ Object: "AddCommentOperation", Args: nil, Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.AddCommentOperation().Date(ctx, obj) }) - return graphql.Defer(func() (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - userErr := ec.Recover(ctx, r) - ec.Error(ctx, userErr) - ret = graphql.Null - } - }() - - resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.AddCommentOperation_date(ctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } - res := resTmp.(time.Time) - return graphql.MarshalTime(res) - }) + return graphql.Null + } + res := resTmp.(time.Time) + rctx.Result = res + return graphql.MarshalTime(res) } +// nolint: vetshadow func (ec *executionContext) _AddCommentOperation_message(ctx context.Context, field graphql.CollectedField, obj *operations.AddCommentOperation) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "AddCommentOperation" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Message + rctx := &graphql.ResolverContext{ + Object: "AddCommentOperation", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Message, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _AddCommentOperation_files(ctx context.Context, field graphql.CollectedField, obj *operations.AddCommentOperation) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "AddCommentOperation" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Files - arr1 := graphql.Array{} + rctx := &graphql.ResolverContext{ + Object: "AddCommentOperation", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Files, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]git.Hash) + rctx.Result = res + + arr1 := make(graphql.Array, len(res)) + for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + arr1[idx1] = func() graphql.Marshaler { return res[idx1] - }()) + }() } + return arr1 } var bugImplementors = []string{"Bug"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _Bug(ctx context.Context, sel []query.Selection, obj *bug.Snapshot) graphql.Marshaler { - fields := graphql.CollectFields(ec.Doc, sel, bugImplementors, ec.Variables) +func (ec *executionContext) _Bug(ctx context.Context, sel ast.SelectionSet, obj *bug.Snapshot) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, bugImplementors) + var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) + invalid := false for i, field := range fields { out.Keys[i] = field.Alias @@ -368,356 +1559,333 @@ func (ec *executionContext) _Bug(ctx context.Context, sel []query.Selection, obj out.Values[i] = graphql.MarshalString("Bug") case "id": out.Values[i] = ec._Bug_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "humanId": out.Values[i] = ec._Bug_humanId(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "status": - out.Values[i] = ec._Bug_status(ctx, field, obj) + wg.Add(1) + go func(i int, field graphql.CollectedField) { + out.Values[i] = ec._Bug_status(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + wg.Done() + }(i, field) case "title": out.Values[i] = ec._Bug_title(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "labels": out.Values[i] = ec._Bug_labels(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "author": out.Values[i] = ec._Bug_author(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "createdAt": out.Values[i] = ec._Bug_createdAt(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "lastEdit": - out.Values[i] = ec._Bug_lastEdit(ctx, field, obj) + wg.Add(1) + go func(i int, field graphql.CollectedField) { + out.Values[i] = ec._Bug_lastEdit(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + wg.Done() + }(i, field) case "comments": - out.Values[i] = ec._Bug_comments(ctx, field, obj) + wg.Add(1) + go func(i int, field graphql.CollectedField) { + out.Values[i] = ec._Bug_comments(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + wg.Done() + }(i, field) case "operations": - out.Values[i] = ec._Bug_operations(ctx, field, obj) + wg.Add(1) + go func(i int, field graphql.CollectedField) { + out.Values[i] = ec._Bug_operations(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + wg.Done() + }(i, field) default: panic("unknown field " + strconv.Quote(field.Name)) } } - + wg.Wait() + if invalid { + return graphql.Null + } return out } +// nolint: vetshadow func (ec *executionContext) _Bug_id(ctx context.Context, field graphql.CollectedField, obj *bug.Snapshot) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "Bug" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Id() + rctx := &graphql.ResolverContext{ + Object: "Bug", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Id(), nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _Bug_humanId(ctx context.Context, field graphql.CollectedField, obj *bug.Snapshot) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "Bug" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.HumanId() + rctx := &graphql.ResolverContext{ + Object: "Bug", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.HumanId(), nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _Bug_status(ctx context.Context, field graphql.CollectedField, obj *bug.Snapshot) graphql.Marshaler { - ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ + rctx := &graphql.ResolverContext{ Object: "Bug", Args: nil, Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.Bug().Status(ctx, obj) }) - return graphql.Defer(func() (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - userErr := ec.Recover(ctx, r) - ec.Error(ctx, userErr) - ret = graphql.Null - } - }() - - resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.Bug_status(ctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } - res := resTmp.(models.Status) - return res - }) + return graphql.Null + } + res := resTmp.(models.Status) + rctx.Result = res + return res } +// nolint: vetshadow func (ec *executionContext) _Bug_title(ctx context.Context, field graphql.CollectedField, obj *bug.Snapshot) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "Bug" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Title + rctx := &graphql.ResolverContext{ + Object: "Bug", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Title, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _Bug_labels(ctx context.Context, field graphql.CollectedField, obj *bug.Snapshot) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "Bug" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Labels - arr1 := graphql.Array{} + rctx := &graphql.ResolverContext{ + Object: "Bug", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Labels, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]bug.Label) + rctx.Result = res + + arr1 := make(graphql.Array, len(res)) + for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + arr1[idx1] = func() graphql.Marshaler { return res[idx1] - }()) + }() } + return arr1 } +// nolint: vetshadow func (ec *executionContext) _Bug_author(ctx context.Context, field graphql.CollectedField, obj *bug.Snapshot) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "Bug" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Author - return ec._Person(ctx, field.Selections, &res) -} - -func (ec *executionContext) _Bug_createdAt(ctx context.Context, field graphql.CollectedField, obj *bug.Snapshot) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "Bug" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.CreatedAt - return graphql.MarshalTime(res) -} - -func (ec *executionContext) _Bug_lastEdit(ctx context.Context, field graphql.CollectedField, obj *bug.Snapshot) graphql.Marshaler { - ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ + rctx := &graphql.ResolverContext{ Object: "Bug", Args: nil, Field: field, - }) - return graphql.Defer(func() (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - userErr := ec.Recover(ctx, r) - ec.Error(ctx, userErr) - ret = graphql.Null - } - }() - - resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.Bug_lastEdit(ctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(time.Time) - return graphql.MarshalTime(res) - }) -} - -func (ec *executionContext) _Bug_comments(ctx context.Context, field graphql.CollectedField, obj *bug.Snapshot) graphql.Marshaler { - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := field.Args["after"]; ok { - var err error - var ptr1 string - if tmp != nil { - ptr1, err = graphql.UnmarshalString(tmp) - arg0 = &ptr1 - } - - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } } - args["after"] = arg0 - var arg1 *string - if tmp, ok := field.Args["before"]; ok { - var err error - var ptr1 string - if tmp != nil { - ptr1, err = graphql.UnmarshalString(tmp) - arg1 = &ptr1 - } - - if err != nil { - ec.Error(ctx, err) - return graphql.Null + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Author, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null } - args["before"] = arg1 - var arg2 *int - if tmp, ok := field.Args["first"]; ok { - var err error - var ptr1 int - if tmp != nil { - ptr1, err = graphql.UnmarshalInt(tmp) - arg2 = &ptr1 - } + res := resTmp.(bug.Person) + rctx.Result = res - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - } - args["first"] = arg2 - var arg3 *int - if tmp, ok := field.Args["last"]; ok { - var err error - var ptr1 int - if tmp != nil { - ptr1, err = graphql.UnmarshalInt(tmp) - arg3 = &ptr1 - } + return ec._Person(ctx, field.Selections, &res) +} - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - } - args["last"] = arg3 - ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ +// nolint: vetshadow +func (ec *executionContext) _Bug_createdAt(ctx context.Context, field graphql.CollectedField, obj *bug.Snapshot) graphql.Marshaler { + rctx := &graphql.ResolverContext{ Object: "Bug", - Args: args, + Args: nil, Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.CreatedAt, nil }) - return graphql.Defer(func() (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - userErr := ec.Recover(ctx, r) - ec.Error(ctx, userErr) - ret = graphql.Null - } - }() - - resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.Bug_comments(ctx, obj, args["after"].(*string), args["before"].(*string), args["first"].(*int), args["last"].(*int)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } - res := resTmp.(models.CommentConnection) - return ec._CommentConnection(ctx, field.Selections, &res) - }) + return graphql.Null + } + res := resTmp.(time.Time) + rctx.Result = res + return graphql.MarshalTime(res) } -func (ec *executionContext) _Bug_operations(ctx context.Context, field graphql.CollectedField, obj *bug.Snapshot) graphql.Marshaler { - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := field.Args["after"]; ok { - var err error - var ptr1 string - if tmp != nil { - ptr1, err = graphql.UnmarshalString(tmp) - arg0 = &ptr1 - } - - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } +// nolint: vetshadow +func (ec *executionContext) _Bug_lastEdit(ctx context.Context, field graphql.CollectedField, obj *bug.Snapshot) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "Bug", + Args: nil, + Field: field, } - args["after"] = arg0 - var arg1 *string - if tmp, ok := field.Args["before"]; ok { - var err error - var ptr1 string - if tmp != nil { - ptr1, err = graphql.UnmarshalString(tmp) - arg1 = &ptr1 - } - - if err != nil { - ec.Error(ctx, err) - return graphql.Null + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.Bug().LastEdit(ctx, obj) + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null } - args["before"] = arg1 - var arg2 *int - if tmp, ok := field.Args["first"]; ok { - var err error - var ptr1 int - if tmp != nil { - ptr1, err = graphql.UnmarshalInt(tmp) - arg2 = &ptr1 - } + res := resTmp.(time.Time) + rctx.Result = res + return graphql.MarshalTime(res) +} - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } +// nolint: vetshadow +func (ec *executionContext) _Bug_comments(ctx context.Context, field graphql.CollectedField, obj *bug.Snapshot) graphql.Marshaler { + rawArgs := field.ArgumentMap(ec.Variables) + args, err := field_Bug_comments_args(rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null } - args["first"] = arg2 - var arg3 *int - if tmp, ok := field.Args["last"]; ok { - var err error - var ptr1 int - if tmp != nil { - ptr1, err = graphql.UnmarshalInt(tmp) - arg3 = &ptr1 + rctx := &graphql.ResolverContext{ + Object: "Bug", + Args: args, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.Bug().Comments(ctx, obj, args["after"].(*string), args["before"].(*string), args["first"].(*int), args["last"].(*int)) + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } + res := resTmp.(models.CommentConnection) + rctx.Result = res - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } + return ec._CommentConnection(ctx, field.Selections, &res) +} + +// nolint: vetshadow +func (ec *executionContext) _Bug_operations(ctx context.Context, field graphql.CollectedField, obj *bug.Snapshot) graphql.Marshaler { + rawArgs := field.ArgumentMap(ec.Variables) + args, err := field_Bug_operations_args(rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null } - args["last"] = arg3 - ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ + rctx := &graphql.ResolverContext{ Object: "Bug", Args: args, Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.Bug().Operations(ctx, obj, args["after"].(*string), args["before"].(*string), args["first"].(*int), args["last"].(*int)) }) - return graphql.Defer(func() (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - userErr := ec.Recover(ctx, r) - ec.Error(ctx, userErr) - ret = graphql.Null - } - }() - - resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.Bug_operations(ctx, obj, args["after"].(*string), args["before"].(*string), args["first"].(*int), args["last"].(*int)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } - res := resTmp.(models.OperationConnection) - return ec._OperationConnection(ctx, field.Selections, &res) - }) + return graphql.Null + } + res := resTmp.(models.OperationConnection) + rctx.Result = res + + return ec._OperationConnection(ctx, field.Selections, &res) } var bugConnectionImplementors = []string{"BugConnection"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _BugConnection(ctx context.Context, sel []query.Selection, obj *models.BugConnection) graphql.Marshaler { - fields := graphql.CollectFields(ec.Doc, sel, bugConnectionImplementors, ec.Variables) +func (ec *executionContext) _BugConnection(ctx context.Context, sel ast.SelectionSet, obj *models.BugConnection) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, bugConnectionImplementors) out := graphql.NewOrderedMap(len(fields)) + invalid := false for i, field := range fields { out.Keys[i] = field.Alias @@ -726,89 +1894,198 @@ func (ec *executionContext) _BugConnection(ctx context.Context, sel []query.Sele out.Values[i] = graphql.MarshalString("BugConnection") case "edges": out.Values[i] = ec._BugConnection_edges(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "nodes": out.Values[i] = ec._BugConnection_nodes(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "pageInfo": out.Values[i] = ec._BugConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "totalCount": out.Values[i] = ec._BugConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } default: panic("unknown field " + strconv.Quote(field.Name)) } } + if invalid { + return graphql.Null + } return out } +// nolint: vetshadow func (ec *executionContext) _BugConnection_edges(ctx context.Context, field graphql.CollectedField, obj *models.BugConnection) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "BugConnection" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Edges - arr1 := graphql.Array{} + rctx := &graphql.ResolverContext{ + Object: "BugConnection", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Edges, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]models.BugEdge) + rctx.Result = res + + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup + + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } + for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() - return ec._BugEdge(ctx, field.Selections, &res[idx1]) - }()) + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() + } + arr1[idx1] = func() graphql.Marshaler { + + return ec._BugEdge(ctx, field.Selections, &res[idx1]) + }() + } + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + } + wg.Wait() return arr1 } +// nolint: vetshadow func (ec *executionContext) _BugConnection_nodes(ctx context.Context, field graphql.CollectedField, obj *models.BugConnection) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "BugConnection" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Nodes - arr1 := graphql.Array{} + rctx := &graphql.ResolverContext{ + Object: "BugConnection", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Nodes, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]bug.Snapshot) + rctx.Result = res + + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup + + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } + for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() - return ec._Bug(ctx, field.Selections, &res[idx1]) - }()) + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() + } + arr1[idx1] = func() graphql.Marshaler { + + return ec._Bug(ctx, field.Selections, &res[idx1]) + }() + } + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + } + wg.Wait() return arr1 } +// nolint: vetshadow func (ec *executionContext) _BugConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *models.BugConnection) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "BugConnection" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.PageInfo + rctx := &graphql.ResolverContext{ + Object: "BugConnection", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.PageInfo, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(models.PageInfo) + rctx.Result = res + return ec._PageInfo(ctx, field.Selections, &res) } +// nolint: vetshadow func (ec *executionContext) _BugConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *models.BugConnection) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "BugConnection" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.TotalCount + rctx := &graphql.ResolverContext{ + Object: "BugConnection", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.TotalCount, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + rctx.Result = res return graphql.MarshalInt(res) } var bugEdgeImplementors = []string{"BugEdge"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _BugEdge(ctx context.Context, sel []query.Selection, obj *models.BugEdge) graphql.Marshaler { - fields := graphql.CollectFields(ec.Doc, sel, bugEdgeImplementors, ec.Variables) +func (ec *executionContext) _BugEdge(ctx context.Context, sel ast.SelectionSet, obj *models.BugEdge) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, bugEdgeImplementors) out := graphql.NewOrderedMap(len(fields)) + invalid := false for i, field := range fields { out.Keys[i] = field.Alias @@ -817,45 +2094,78 @@ func (ec *executionContext) _BugEdge(ctx context.Context, sel []query.Selection, out.Values[i] = graphql.MarshalString("BugEdge") case "cursor": out.Values[i] = ec._BugEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "node": out.Values[i] = ec._BugEdge_node(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } default: panic("unknown field " + strconv.Quote(field.Name)) } } + if invalid { + return graphql.Null + } return out } +// nolint: vetshadow func (ec *executionContext) _BugEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *models.BugEdge) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "BugEdge" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Cursor + rctx := &graphql.ResolverContext{ + Object: "BugEdge", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Cursor, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _BugEdge_node(ctx context.Context, field graphql.CollectedField, obj *models.BugEdge) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "BugEdge" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Node + rctx := &graphql.ResolverContext{ + Object: "BugEdge", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Node, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bug.Snapshot) + rctx.Result = res + return ec._Bug(ctx, field.Selections, &res) } var commentImplementors = []string{"Comment", "Authored"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _Comment(ctx context.Context, sel []query.Selection, obj *bug.Comment) graphql.Marshaler { - fields := graphql.CollectFields(ec.Doc, sel, commentImplementors, ec.Variables) +func (ec *executionContext) _Comment(ctx context.Context, sel ast.SelectionSet, obj *bug.Comment) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, commentImplementors) out := graphql.NewOrderedMap(len(fields)) + invalid := false for i, field := range fields { out.Keys[i] = field.Alias @@ -864,67 +2174,114 @@ func (ec *executionContext) _Comment(ctx context.Context, sel []query.Selection, out.Values[i] = graphql.MarshalString("Comment") case "author": out.Values[i] = ec._Comment_author(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "message": out.Values[i] = ec._Comment_message(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "files": out.Values[i] = ec._Comment_files(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } default: panic("unknown field " + strconv.Quote(field.Name)) } } + if invalid { + return graphql.Null + } return out } +// nolint: vetshadow func (ec *executionContext) _Comment_author(ctx context.Context, field graphql.CollectedField, obj *bug.Comment) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "Comment" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Author + rctx := &graphql.ResolverContext{ + Object: "Comment", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Author, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bug.Person) + rctx.Result = res + return ec._Person(ctx, field.Selections, &res) } +// nolint: vetshadow func (ec *executionContext) _Comment_message(ctx context.Context, field graphql.CollectedField, obj *bug.Comment) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "Comment" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Message + rctx := &graphql.ResolverContext{ + Object: "Comment", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Message, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _Comment_files(ctx context.Context, field graphql.CollectedField, obj *bug.Comment) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "Comment" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Files - arr1 := graphql.Array{} + rctx := &graphql.ResolverContext{ + Object: "Comment", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Files, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]git.Hash) + rctx.Result = res + + arr1 := make(graphql.Array, len(res)) + for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + arr1[idx1] = func() graphql.Marshaler { return res[idx1] - }()) + }() } + return arr1 } var commentConnectionImplementors = []string{"CommentConnection"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _CommentConnection(ctx context.Context, sel []query.Selection, obj *models.CommentConnection) graphql.Marshaler { - fields := graphql.CollectFields(ec.Doc, sel, commentConnectionImplementors, ec.Variables) +func (ec *executionContext) _CommentConnection(ctx context.Context, sel ast.SelectionSet, obj *models.CommentConnection) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, commentConnectionImplementors) out := graphql.NewOrderedMap(len(fields)) + invalid := false for i, field := range fields { out.Keys[i] = field.Alias @@ -933,89 +2290,198 @@ func (ec *executionContext) _CommentConnection(ctx context.Context, sel []query. out.Values[i] = graphql.MarshalString("CommentConnection") case "edges": out.Values[i] = ec._CommentConnection_edges(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "nodes": out.Values[i] = ec._CommentConnection_nodes(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "pageInfo": out.Values[i] = ec._CommentConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "totalCount": out.Values[i] = ec._CommentConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } default: panic("unknown field " + strconv.Quote(field.Name)) } } + if invalid { + return graphql.Null + } return out } +// nolint: vetshadow func (ec *executionContext) _CommentConnection_edges(ctx context.Context, field graphql.CollectedField, obj *models.CommentConnection) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "CommentConnection" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Edges - arr1 := graphql.Array{} + rctx := &graphql.ResolverContext{ + Object: "CommentConnection", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Edges, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]models.CommentEdge) + rctx.Result = res + + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup + + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } + for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() - return ec._CommentEdge(ctx, field.Selections, &res[idx1]) - }()) + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() + } + arr1[idx1] = func() graphql.Marshaler { + + return ec._CommentEdge(ctx, field.Selections, &res[idx1]) + }() + } + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + } + wg.Wait() return arr1 } +// nolint: vetshadow func (ec *executionContext) _CommentConnection_nodes(ctx context.Context, field graphql.CollectedField, obj *models.CommentConnection) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "CommentConnection" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Nodes - arr1 := graphql.Array{} + rctx := &graphql.ResolverContext{ + Object: "CommentConnection", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Nodes, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]bug.Comment) + rctx.Result = res + + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup + + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } + for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() - return ec._Comment(ctx, field.Selections, &res[idx1]) - }()) + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() + } + arr1[idx1] = func() graphql.Marshaler { + + return ec._Comment(ctx, field.Selections, &res[idx1]) + }() + } + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + } + wg.Wait() return arr1 } +// nolint: vetshadow func (ec *executionContext) _CommentConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *models.CommentConnection) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "CommentConnection" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.PageInfo + rctx := &graphql.ResolverContext{ + Object: "CommentConnection", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.PageInfo, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(models.PageInfo) + rctx.Result = res + return ec._PageInfo(ctx, field.Selections, &res) } +// nolint: vetshadow func (ec *executionContext) _CommentConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *models.CommentConnection) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "CommentConnection" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.TotalCount + rctx := &graphql.ResolverContext{ + Object: "CommentConnection", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.TotalCount, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + rctx.Result = res return graphql.MarshalInt(res) } var commentEdgeImplementors = []string{"CommentEdge"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _CommentEdge(ctx context.Context, sel []query.Selection, obj *models.CommentEdge) graphql.Marshaler { - fields := graphql.CollectFields(ec.Doc, sel, commentEdgeImplementors, ec.Variables) +func (ec *executionContext) _CommentEdge(ctx context.Context, sel ast.SelectionSet, obj *models.CommentEdge) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, commentEdgeImplementors) out := graphql.NewOrderedMap(len(fields)) + invalid := false for i, field := range fields { out.Keys[i] = field.Alias @@ -1024,45 +2490,79 @@ func (ec *executionContext) _CommentEdge(ctx context.Context, sel []query.Select out.Values[i] = graphql.MarshalString("CommentEdge") case "cursor": out.Values[i] = ec._CommentEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "node": out.Values[i] = ec._CommentEdge_node(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } default: panic("unknown field " + strconv.Quote(field.Name)) } } + if invalid { + return graphql.Null + } return out } +// nolint: vetshadow func (ec *executionContext) _CommentEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *models.CommentEdge) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "CommentEdge" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Cursor + rctx := &graphql.ResolverContext{ + Object: "CommentEdge", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Cursor, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _CommentEdge_node(ctx context.Context, field graphql.CollectedField, obj *models.CommentEdge) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "CommentEdge" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Node + rctx := &graphql.ResolverContext{ + Object: "CommentEdge", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Node, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bug.Comment) + rctx.Result = res + return ec._Comment(ctx, field.Selections, &res) } var createOperationImplementors = []string{"CreateOperation", "Operation", "Authored"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _CreateOperation(ctx context.Context, sel []query.Selection, obj *operations.CreateOperation) graphql.Marshaler { - fields := graphql.CollectFields(ec.Doc, sel, createOperationImplementors, ec.Variables) +func (ec *executionContext) _CreateOperation(ctx context.Context, sel ast.SelectionSet, obj *operations.CreateOperation) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, createOperationImplementors) + var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) + invalid := false for i, field := range fields { out.Keys[i] = field.Alias @@ -1071,112 +2571,173 @@ func (ec *executionContext) _CreateOperation(ctx context.Context, sel []query.Se out.Values[i] = graphql.MarshalString("CreateOperation") case "author": out.Values[i] = ec._CreateOperation_author(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "date": - out.Values[i] = ec._CreateOperation_date(ctx, field, obj) + wg.Add(1) + go func(i int, field graphql.CollectedField) { + out.Values[i] = ec._CreateOperation_date(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + wg.Done() + }(i, field) case "title": out.Values[i] = ec._CreateOperation_title(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "message": out.Values[i] = ec._CreateOperation_message(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "files": out.Values[i] = ec._CreateOperation_files(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } default: panic("unknown field " + strconv.Quote(field.Name)) } } - + wg.Wait() + if invalid { + return graphql.Null + } return out } +// nolint: vetshadow func (ec *executionContext) _CreateOperation_author(ctx context.Context, field graphql.CollectedField, obj *operations.CreateOperation) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "CreateOperation" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Author + rctx := &graphql.ResolverContext{ + Object: "CreateOperation", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Author, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bug.Person) + rctx.Result = res + return ec._Person(ctx, field.Selections, &res) } +// nolint: vetshadow func (ec *executionContext) _CreateOperation_date(ctx context.Context, field graphql.CollectedField, obj *operations.CreateOperation) graphql.Marshaler { - ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ + rctx := &graphql.ResolverContext{ Object: "CreateOperation", Args: nil, Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.CreateOperation().Date(ctx, obj) }) - return graphql.Defer(func() (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - userErr := ec.Recover(ctx, r) - ec.Error(ctx, userErr) - ret = graphql.Null - } - }() - - resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.CreateOperation_date(ctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } - res := resTmp.(time.Time) - return graphql.MarshalTime(res) + return graphql.Null + } + res := resTmp.(time.Time) + rctx.Result = res + return graphql.MarshalTime(res) +} + +// nolint: vetshadow +func (ec *executionContext) _CreateOperation_title(ctx context.Context, field graphql.CollectedField, obj *operations.CreateOperation) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "CreateOperation", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Title, nil }) -} - -func (ec *executionContext) _CreateOperation_title(ctx context.Context, field graphql.CollectedField, obj *operations.CreateOperation) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "CreateOperation" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Title + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _CreateOperation_message(ctx context.Context, field graphql.CollectedField, obj *operations.CreateOperation) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "CreateOperation" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Message + rctx := &graphql.ResolverContext{ + Object: "CreateOperation", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Message, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _CreateOperation_files(ctx context.Context, field graphql.CollectedField, obj *operations.CreateOperation) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "CreateOperation" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Files - arr1 := graphql.Array{} + rctx := &graphql.ResolverContext{ + Object: "CreateOperation", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Files, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]git.Hash) + rctx.Result = res + + arr1 := make(graphql.Array, len(res)) + for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + arr1[idx1] = func() graphql.Marshaler { return res[idx1] - }()) + }() } + return arr1 } var labelChangeOperationImplementors = []string{"LabelChangeOperation", "Operation", "Authored"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _LabelChangeOperation(ctx context.Context, sel []query.Selection, obj *operations.LabelChangeOperation) graphql.Marshaler { - fields := graphql.CollectFields(ec.Doc, sel, labelChangeOperationImplementors, ec.Variables) +func (ec *executionContext) _LabelChangeOperation(ctx context.Context, sel ast.SelectionSet, obj *operations.LabelChangeOperation) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, labelChangeOperationImplementors) + var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) + invalid := false for i, field := range fields { out.Keys[i] = field.Alias @@ -1185,112 +2746,158 @@ func (ec *executionContext) _LabelChangeOperation(ctx context.Context, sel []que out.Values[i] = graphql.MarshalString("LabelChangeOperation") case "author": out.Values[i] = ec._LabelChangeOperation_author(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "date": - out.Values[i] = ec._LabelChangeOperation_date(ctx, field, obj) + wg.Add(1) + go func(i int, field graphql.CollectedField) { + out.Values[i] = ec._LabelChangeOperation_date(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + wg.Done() + }(i, field) case "added": out.Values[i] = ec._LabelChangeOperation_added(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "removed": out.Values[i] = ec._LabelChangeOperation_removed(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } default: panic("unknown field " + strconv.Quote(field.Name)) } } - + wg.Wait() + if invalid { + return graphql.Null + } return out } +// nolint: vetshadow func (ec *executionContext) _LabelChangeOperation_author(ctx context.Context, field graphql.CollectedField, obj *operations.LabelChangeOperation) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "LabelChangeOperation" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Author + rctx := &graphql.ResolverContext{ + Object: "LabelChangeOperation", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Author, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bug.Person) + rctx.Result = res + return ec._Person(ctx, field.Selections, &res) } +// nolint: vetshadow func (ec *executionContext) _LabelChangeOperation_date(ctx context.Context, field graphql.CollectedField, obj *operations.LabelChangeOperation) graphql.Marshaler { - ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ + rctx := &graphql.ResolverContext{ Object: "LabelChangeOperation", Args: nil, Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.LabelChangeOperation().Date(ctx, obj) }) - return graphql.Defer(func() (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - userErr := ec.Recover(ctx, r) - ec.Error(ctx, userErr) - ret = graphql.Null - } - }() - - resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.LabelChangeOperation_date(ctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } - res := resTmp.(time.Time) - return graphql.MarshalTime(res) - }) + return graphql.Null + } + res := resTmp.(time.Time) + rctx.Result = res + return graphql.MarshalTime(res) } +// nolint: vetshadow func (ec *executionContext) _LabelChangeOperation_added(ctx context.Context, field graphql.CollectedField, obj *operations.LabelChangeOperation) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "LabelChangeOperation" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Added - arr1 := graphql.Array{} + rctx := &graphql.ResolverContext{ + Object: "LabelChangeOperation", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Added, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]bug.Label) + rctx.Result = res + + arr1 := make(graphql.Array, len(res)) + for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + arr1[idx1] = func() graphql.Marshaler { return res[idx1] - }()) + }() } + return arr1 } +// nolint: vetshadow func (ec *executionContext) _LabelChangeOperation_removed(ctx context.Context, field graphql.CollectedField, obj *operations.LabelChangeOperation) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "LabelChangeOperation" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Removed - arr1 := graphql.Array{} + rctx := &graphql.ResolverContext{ + Object: "LabelChangeOperation", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Removed, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]bug.Label) + rctx.Result = res + + arr1 := make(graphql.Array, len(res)) + for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + arr1[idx1] = func() graphql.Marshaler { return res[idx1] - }()) + }() } + return arr1 } var mutationImplementors = []string{"Mutation"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _Mutation(ctx context.Context, sel []query.Selection) graphql.Marshaler { - fields := graphql.CollectFields(ec.Doc, sel, mutationImplementors, ec.Variables) +func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, mutationImplementors) ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ Object: "Mutation", }) out := graphql.NewOrderedMap(len(fields)) + invalid := false for i, field := range fields { out.Keys[i] = field.Alias @@ -1299,468 +2906,261 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel []query.Selection out.Values[i] = graphql.MarshalString("Mutation") case "newBug": out.Values[i] = ec._Mutation_newBug(ctx, field) + if out.Values[i] == graphql.Null { + invalid = true + } case "addComment": out.Values[i] = ec._Mutation_addComment(ctx, field) + if out.Values[i] == graphql.Null { + invalid = true + } case "changeLabels": out.Values[i] = ec._Mutation_changeLabels(ctx, field) + if out.Values[i] == graphql.Null { + invalid = true + } case "open": out.Values[i] = ec._Mutation_open(ctx, field) - case "close": - out.Values[i] = ec._Mutation_close(ctx, field) - case "setTitle": - out.Values[i] = ec._Mutation_setTitle(ctx, field) - case "commit": - out.Values[i] = ec._Mutation_commit(ctx, field) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - - return out -} - -func (ec *executionContext) _Mutation_newBug(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := field.Args["repoRef"]; ok { - var err error - var ptr1 string - if tmp != nil { - ptr1, err = graphql.UnmarshalString(tmp) - arg0 = &ptr1 - } - - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - } - args["repoRef"] = arg0 - var arg1 string - if tmp, ok := field.Args["title"]; ok { - var err error - arg1, err = graphql.UnmarshalString(tmp) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - } - args["title"] = arg1 - var arg2 string - if tmp, ok := field.Args["message"]; ok { - var err error - arg2, err = graphql.UnmarshalString(tmp) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - } - args["message"] = arg2 - var arg3 []git.Hash - if tmp, ok := field.Args["files"]; ok { - var err error - var rawIf1 []interface{} - if tmp != nil { - if tmp1, ok := tmp.([]interface{}); ok { - rawIf1 = tmp1 - } - } - arg3 = make([]git.Hash, len(rawIf1)) - for idx1 := range rawIf1 { - err = (&arg3[idx1]).UnmarshalGQL(rawIf1[idx1]) - } - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - } - args["files"] = arg3 - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "Mutation" - rctx.Args = args - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.Mutation_newBug(ctx, args["repoRef"].(*string), args["title"].(string), args["message"].(string), args["files"].([]git.Hash)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(bug.Snapshot) - return ec._Bug(ctx, field.Selections, &res) -} - -func (ec *executionContext) _Mutation_addComment(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := field.Args["repoRef"]; ok { - var err error - var ptr1 string - if tmp != nil { - ptr1, err = graphql.UnmarshalString(tmp) - arg0 = &ptr1 - } - - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - } - args["repoRef"] = arg0 - var arg1 string - if tmp, ok := field.Args["prefix"]; ok { - var err error - arg1, err = graphql.UnmarshalString(tmp) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - } - args["prefix"] = arg1 - var arg2 string - if tmp, ok := field.Args["message"]; ok { - var err error - arg2, err = graphql.UnmarshalString(tmp) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - } - args["message"] = arg2 - var arg3 []git.Hash - if tmp, ok := field.Args["files"]; ok { - var err error - var rawIf1 []interface{} - if tmp != nil { - if tmp1, ok := tmp.([]interface{}); ok { - rawIf1 = tmp1 - } - } - arg3 = make([]git.Hash, len(rawIf1)) - for idx1 := range rawIf1 { - err = (&arg3[idx1]).UnmarshalGQL(rawIf1[idx1]) - } - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - } - args["files"] = arg3 - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "Mutation" - rctx.Args = args - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.Mutation_addComment(ctx, args["repoRef"].(*string), args["prefix"].(string), args["message"].(string), args["files"].([]git.Hash)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(bug.Snapshot) - return ec._Bug(ctx, field.Selections, &res) -} - -func (ec *executionContext) _Mutation_changeLabels(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := field.Args["repoRef"]; ok { - var err error - var ptr1 string - if tmp != nil { - ptr1, err = graphql.UnmarshalString(tmp) - arg0 = &ptr1 - } - - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - } - args["repoRef"] = arg0 - var arg1 string - if tmp, ok := field.Args["prefix"]; ok { - var err error - arg1, err = graphql.UnmarshalString(tmp) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - } - args["prefix"] = arg1 - var arg2 []string - if tmp, ok := field.Args["added"]; ok { - var err error - var rawIf1 []interface{} - if tmp != nil { - if tmp1, ok := tmp.([]interface{}); ok { - rawIf1 = tmp1 + if out.Values[i] == graphql.Null { + invalid = true } - } - arg2 = make([]string, len(rawIf1)) - for idx1 := range rawIf1 { - arg2[idx1], err = graphql.UnmarshalString(rawIf1[idx1]) - } - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - } - args["added"] = arg2 - var arg3 []string - if tmp, ok := field.Args["removed"]; ok { - var err error - var rawIf1 []interface{} - if tmp != nil { - if tmp1, ok := tmp.([]interface{}); ok { - rawIf1 = tmp1 + case "close": + out.Values[i] = ec._Mutation_close(ctx, field) + if out.Values[i] == graphql.Null { + invalid = true } - } - arg3 = make([]string, len(rawIf1)) - for idx1 := range rawIf1 { - arg3[idx1], err = graphql.UnmarshalString(rawIf1[idx1]) - } - if err != nil { - ec.Error(ctx, err) - return graphql.Null + case "setTitle": + out.Values[i] = ec._Mutation_setTitle(ctx, field) + if out.Values[i] == graphql.Null { + invalid = true + } + case "commit": + out.Values[i] = ec._Mutation_commit(ctx, field) + if out.Values[i] == graphql.Null { + invalid = true + } + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - args["removed"] = arg3 - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "Mutation" - rctx.Args = args - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.Mutation_changeLabels(ctx, args["repoRef"].(*string), args["prefix"].(string), args["added"].([]string), args["removed"].([]string)) - }) + + if invalid { + return graphql.Null + } + return out +} + +// nolint: vetshadow +func (ec *executionContext) _Mutation_newBug(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { + rawArgs := field.ArgumentMap(ec.Variables) + args, err := field_Mutation_newBug_args(rawArgs) if err != nil { ec.Error(ctx, err) return graphql.Null } + rctx := &graphql.ResolverContext{ + Object: "Mutation", + Args: args, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, nil, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.Mutation().NewBug(ctx, args["repoRef"].(*string), args["title"].(string), args["message"].(string), args["files"].([]git.Hash)) + }) if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } res := resTmp.(bug.Snapshot) + rctx.Result = res + return ec._Bug(ctx, field.Selections, &res) } -func (ec *executionContext) _Mutation_open(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := field.Args["repoRef"]; ok { - var err error - var ptr1 string - if tmp != nil { - ptr1, err = graphql.UnmarshalString(tmp) - arg0 = &ptr1 - } - - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - } - args["repoRef"] = arg0 - var arg1 string - if tmp, ok := field.Args["prefix"]; ok { - var err error - arg1, err = graphql.UnmarshalString(tmp) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - } - args["prefix"] = arg1 - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "Mutation" - rctx.Args = args - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.Mutation_open(ctx, args["repoRef"].(*string), args["prefix"].(string)) - }) +// nolint: vetshadow +func (ec *executionContext) _Mutation_addComment(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { + rawArgs := field.ArgumentMap(ec.Variables) + args, err := field_Mutation_addComment_args(rawArgs) if err != nil { ec.Error(ctx, err) return graphql.Null } + rctx := &graphql.ResolverContext{ + Object: "Mutation", + Args: args, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, nil, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.Mutation().AddComment(ctx, args["repoRef"].(*string), args["prefix"].(string), args["message"].(string), args["files"].([]git.Hash)) + }) if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } res := resTmp.(bug.Snapshot) + rctx.Result = res + return ec._Bug(ctx, field.Selections, &res) } -func (ec *executionContext) _Mutation_close(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := field.Args["repoRef"]; ok { - var err error - var ptr1 string - if tmp != nil { - ptr1, err = graphql.UnmarshalString(tmp) - arg0 = &ptr1 - } - - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } +// nolint: vetshadow +func (ec *executionContext) _Mutation_changeLabels(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { + rawArgs := field.ArgumentMap(ec.Variables) + args, err := field_Mutation_changeLabels_args(rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null } - args["repoRef"] = arg0 - var arg1 string - if tmp, ok := field.Args["prefix"]; ok { - var err error - arg1, err = graphql.UnmarshalString(tmp) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } + rctx := &graphql.ResolverContext{ + Object: "Mutation", + Args: args, + Field: field, } - args["prefix"] = arg1 - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "Mutation" - rctx.Args = args - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.Mutation_close(ctx, args["repoRef"].(*string), args["prefix"].(string)) + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, nil, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.Mutation().ChangeLabels(ctx, args["repoRef"].(*string), args["prefix"].(string), args["added"].([]string), args["removed"].([]string)) }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bug.Snapshot) + rctx.Result = res + + return ec._Bug(ctx, field.Selections, &res) +} + +// nolint: vetshadow +func (ec *executionContext) _Mutation_open(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { + rawArgs := field.ArgumentMap(ec.Variables) + args, err := field_Mutation_open_args(rawArgs) if err != nil { ec.Error(ctx, err) return graphql.Null } + rctx := &graphql.ResolverContext{ + Object: "Mutation", + Args: args, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, nil, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.Mutation().Open(ctx, args["repoRef"].(*string), args["prefix"].(string)) + }) if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } res := resTmp.(bug.Snapshot) + rctx.Result = res + return ec._Bug(ctx, field.Selections, &res) } -func (ec *executionContext) _Mutation_setTitle(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := field.Args["repoRef"]; ok { - var err error - var ptr1 string - if tmp != nil { - ptr1, err = graphql.UnmarshalString(tmp) - arg0 = &ptr1 - } - - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } +// nolint: vetshadow +func (ec *executionContext) _Mutation_close(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { + rawArgs := field.ArgumentMap(ec.Variables) + args, err := field_Mutation_close_args(rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null } - args["repoRef"] = arg0 - var arg1 string - if tmp, ok := field.Args["prefix"]; ok { - var err error - arg1, err = graphql.UnmarshalString(tmp) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } + rctx := &graphql.ResolverContext{ + Object: "Mutation", + Args: args, + Field: field, } - args["prefix"] = arg1 - var arg2 string - if tmp, ok := field.Args["title"]; ok { - var err error - arg2, err = graphql.UnmarshalString(tmp) - if err != nil { - ec.Error(ctx, err) - return graphql.Null + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, nil, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.Mutation().Close(ctx, args["repoRef"].(*string), args["prefix"].(string)) + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null } - args["title"] = arg2 - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "Mutation" - rctx.Args = args - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.Mutation_setTitle(ctx, args["repoRef"].(*string), args["prefix"].(string), args["title"].(string)) - }) + res := resTmp.(bug.Snapshot) + rctx.Result = res + + return ec._Bug(ctx, field.Selections, &res) +} + +// nolint: vetshadow +func (ec *executionContext) _Mutation_setTitle(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { + rawArgs := field.ArgumentMap(ec.Variables) + args, err := field_Mutation_setTitle_args(rawArgs) if err != nil { ec.Error(ctx, err) return graphql.Null } + rctx := &graphql.ResolverContext{ + Object: "Mutation", + Args: args, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, nil, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.Mutation().SetTitle(ctx, args["repoRef"].(*string), args["prefix"].(string), args["title"].(string)) + }) if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } res := resTmp.(bug.Snapshot) + rctx.Result = res + return ec._Bug(ctx, field.Selections, &res) } +// nolint: vetshadow func (ec *executionContext) _Mutation_commit(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := field.Args["repoRef"]; ok { - var err error - var ptr1 string - if tmp != nil { - ptr1, err = graphql.UnmarshalString(tmp) - arg0 = &ptr1 - } - - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - } - args["repoRef"] = arg0 - var arg1 string - if tmp, ok := field.Args["prefix"]; ok { - var err error - arg1, err = graphql.UnmarshalString(tmp) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - } - args["prefix"] = arg1 - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "Mutation" - rctx.Args = args - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.Mutation_commit(ctx, args["repoRef"].(*string), args["prefix"].(string)) - }) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := field_Mutation_commit_args(rawArgs) if err != nil { ec.Error(ctx, err) return graphql.Null } + rctx := &graphql.ResolverContext{ + Object: "Mutation", + Args: args, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, nil, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.Mutation().Commit(ctx, args["repoRef"].(*string), args["prefix"].(string)) + }) if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } res := resTmp.(bug.Snapshot) + rctx.Result = res + return ec._Bug(ctx, field.Selections, &res) } var operationConnectionImplementors = []string{"OperationConnection"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _OperationConnection(ctx context.Context, sel []query.Selection, obj *models.OperationConnection) graphql.Marshaler { - fields := graphql.CollectFields(ec.Doc, sel, operationConnectionImplementors, ec.Variables) +func (ec *executionContext) _OperationConnection(ctx context.Context, sel ast.SelectionSet, obj *models.OperationConnection) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, operationConnectionImplementors) out := graphql.NewOrderedMap(len(fields)) + invalid := false for i, field := range fields { out.Keys[i] = field.Alias @@ -1769,89 +3169,198 @@ func (ec *executionContext) _OperationConnection(ctx context.Context, sel []quer out.Values[i] = graphql.MarshalString("OperationConnection") case "edges": out.Values[i] = ec._OperationConnection_edges(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "nodes": out.Values[i] = ec._OperationConnection_nodes(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "pageInfo": out.Values[i] = ec._OperationConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "totalCount": out.Values[i] = ec._OperationConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } default: panic("unknown field " + strconv.Quote(field.Name)) } } + if invalid { + return graphql.Null + } return out } +// nolint: vetshadow func (ec *executionContext) _OperationConnection_edges(ctx context.Context, field graphql.CollectedField, obj *models.OperationConnection) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "OperationConnection" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Edges - arr1 := graphql.Array{} + rctx := &graphql.ResolverContext{ + Object: "OperationConnection", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Edges, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]models.OperationEdge) + rctx.Result = res + + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup + + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } + for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() - return ec._OperationEdge(ctx, field.Selections, &res[idx1]) - }()) + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() + } + arr1[idx1] = func() graphql.Marshaler { + + return ec._OperationEdge(ctx, field.Selections, &res[idx1]) + }() + } + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + } + wg.Wait() return arr1 } +// nolint: vetshadow func (ec *executionContext) _OperationConnection_nodes(ctx context.Context, field graphql.CollectedField, obj *models.OperationConnection) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "OperationConnection" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Nodes - arr1 := graphql.Array{} + rctx := &graphql.ResolverContext{ + Object: "OperationConnection", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Nodes, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]bug.Operation) + rctx.Result = res + + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup + + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } + for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() - return ec._Operation(ctx, field.Selections, &res[idx1]) - }()) + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() + } + arr1[idx1] = func() graphql.Marshaler { + + return ec._Operation(ctx, field.Selections, &res[idx1]) + }() + } + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + } + wg.Wait() return arr1 } +// nolint: vetshadow func (ec *executionContext) _OperationConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *models.OperationConnection) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "OperationConnection" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.PageInfo + rctx := &graphql.ResolverContext{ + Object: "OperationConnection", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.PageInfo, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(models.PageInfo) + rctx.Result = res + return ec._PageInfo(ctx, field.Selections, &res) } +// nolint: vetshadow func (ec *executionContext) _OperationConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *models.OperationConnection) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "OperationConnection" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.TotalCount + rctx := &graphql.ResolverContext{ + Object: "OperationConnection", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.TotalCount, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + rctx.Result = res return graphql.MarshalInt(res) } var operationEdgeImplementors = []string{"OperationEdge"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _OperationEdge(ctx context.Context, sel []query.Selection, obj *models.OperationEdge) graphql.Marshaler { - fields := graphql.CollectFields(ec.Doc, sel, operationEdgeImplementors, ec.Variables) +func (ec *executionContext) _OperationEdge(ctx context.Context, sel ast.SelectionSet, obj *models.OperationEdge) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, operationEdgeImplementors) out := graphql.NewOrderedMap(len(fields)) + invalid := false for i, field := range fields { out.Keys[i] = field.Alias @@ -1860,45 +3369,78 @@ func (ec *executionContext) _OperationEdge(ctx context.Context, sel []query.Sele out.Values[i] = graphql.MarshalString("OperationEdge") case "cursor": out.Values[i] = ec._OperationEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "node": out.Values[i] = ec._OperationEdge_node(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } default: panic("unknown field " + strconv.Quote(field.Name)) } } - - return out -} - -func (ec *executionContext) _OperationEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *models.OperationEdge) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "OperationEdge" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Cursor + + if invalid { + return graphql.Null + } + return out +} + +// nolint: vetshadow +func (ec *executionContext) _OperationEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *models.OperationEdge) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "OperationEdge", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Cursor, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _OperationEdge_node(ctx context.Context, field graphql.CollectedField, obj *models.OperationEdge) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "OperationEdge" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Node + rctx := &graphql.ResolverContext{ + Object: "OperationEdge", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Node, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bug.Operation) + rctx.Result = res + return ec._Operation(ctx, field.Selections, &res) } var pageInfoImplementors = []string{"PageInfo"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _PageInfo(ctx context.Context, sel []query.Selection, obj *models.PageInfo) graphql.Marshaler { - fields := graphql.CollectFields(ec.Doc, sel, pageInfoImplementors, ec.Variables) +func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, obj *models.PageInfo) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, pageInfoImplementors) out := graphql.NewOrderedMap(len(fields)) + invalid := false for i, field := range fields { out.Keys[i] = field.Alias @@ -1907,71 +3449,131 @@ func (ec *executionContext) _PageInfo(ctx context.Context, sel []query.Selection out.Values[i] = graphql.MarshalString("PageInfo") case "hasNextPage": out.Values[i] = ec._PageInfo_hasNextPage(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "hasPreviousPage": out.Values[i] = ec._PageInfo_hasPreviousPage(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "startCursor": out.Values[i] = ec._PageInfo_startCursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "endCursor": out.Values[i] = ec._PageInfo_endCursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } default: panic("unknown field " + strconv.Quote(field.Name)) } } + if invalid { + return graphql.Null + } return out } +// nolint: vetshadow func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *models.PageInfo) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "PageInfo" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.HasNextPage + rctx := &graphql.ResolverContext{ + Object: "PageInfo", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.HasNextPage, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField, obj *models.PageInfo) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "PageInfo" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.HasPreviousPage + rctx := &graphql.ResolverContext{ + Object: "PageInfo", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.HasPreviousPage, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *models.PageInfo) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "PageInfo" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.StartCursor + rctx := &graphql.ResolverContext{ + Object: "PageInfo", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.StartCursor, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *models.PageInfo) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "PageInfo" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.EndCursor + rctx := &graphql.ResolverContext{ + Object: "PageInfo", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.EndCursor, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } var personImplementors = []string{"Person"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _Person(ctx context.Context, sel []query.Selection, obj *bug.Person) graphql.Marshaler { - fields := graphql.CollectFields(ec.Doc, sel, personImplementors, ec.Variables) +func (ec *executionContext) _Person(ctx context.Context, sel ast.SelectionSet, obj *bug.Person) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, personImplementors) out := graphql.NewOrderedMap(len(fields)) + invalid := false for i, field := range fields { out.Keys[i] = field.Alias @@ -1987,42 +3589,63 @@ func (ec *executionContext) _Person(ctx context.Context, sel []query.Selection, } } + if invalid { + return graphql.Null + } return out } +// nolint: vetshadow func (ec *executionContext) _Person_email(ctx context.Context, field graphql.CollectedField, obj *bug.Person) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "Person" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Email + rctx := &graphql.ResolverContext{ + Object: "Person", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Email, nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _Person_name(ctx context.Context, field graphql.CollectedField, obj *bug.Person) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "Person" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Name + rctx := &graphql.ResolverContext{ + Object: "Person", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Name, nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } var queryImplementors = []string{"Query"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _Query(ctx context.Context, sel []query.Selection) graphql.Marshaler { - fields := graphql.CollectFields(ec.Doc, sel, queryImplementors, ec.Variables) +func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, queryImplementors) ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ Object: "Query", }) + var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) + invalid := false for i, field := range fields { out.Keys[i] = field.Alias @@ -2030,144 +3653,149 @@ func (ec *executionContext) _Query(ctx context.Context, sel []query.Selection) g case "__typename": out.Values[i] = graphql.MarshalString("Query") case "defaultRepository": - out.Values[i] = ec._Query_defaultRepository(ctx, field) + wg.Add(1) + go func(i int, field graphql.CollectedField) { + out.Values[i] = ec._Query_defaultRepository(ctx, field) + wg.Done() + }(i, field) case "repository": - out.Values[i] = ec._Query_repository(ctx, field) - case "__schema": - out.Values[i] = ec._Query___schema(ctx, field) + wg.Add(1) + go func(i int, field graphql.CollectedField) { + out.Values[i] = ec._Query_repository(ctx, field) + wg.Done() + }(i, field) case "__type": out.Values[i] = ec._Query___type(ctx, field) + case "__schema": + out.Values[i] = ec._Query___schema(ctx, field) default: panic("unknown field " + strconv.Quote(field.Name)) } } - + wg.Wait() + if invalid { + return graphql.Null + } return out } +// nolint: vetshadow func (ec *executionContext) _Query_defaultRepository(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { - ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ + rctx := &graphql.ResolverContext{ Object: "Query", Args: nil, Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, nil, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.Query().DefaultRepository(ctx) }) - return graphql.Defer(func() (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - userErr := ec.Recover(ctx, r) - ec.Error(ctx, userErr) - ret = graphql.Null - } - }() + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*models.Repository) + rctx.Result = res - resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.Query_defaultRepository(ctx) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*models.Repository) - if res == nil { - return graphql.Null - } - return ec._Repository(ctx, field.Selections, res) - }) + if res == nil { + return graphql.Null + } + + return ec._Repository(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) _Query_repository(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { - args := map[string]interface{}{} - var arg0 string - if tmp, ok := field.Args["id"]; ok { - var err error - arg0, err = graphql.UnmarshalString(tmp) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } + rawArgs := field.ArgumentMap(ec.Variables) + args, err := field_Query_repository_args(rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null } - args["id"] = arg0 - ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ + rctx := &graphql.ResolverContext{ Object: "Query", Args: args, Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, nil, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.Query().Repository(ctx, args["id"].(string)) }) - return graphql.Defer(func() (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - userErr := ec.Recover(ctx, r) - ec.Error(ctx, userErr) - ret = graphql.Null - } - }() - - resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.Query_repository(ctx, args["id"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*models.Repository) - if res == nil { - return graphql.Null - } - return ec._Repository(ctx, field.Selections, res) - }) -} + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*models.Repository) + rctx.Result = res -func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "Query" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := ec.introspectSchema() if res == nil { return graphql.Null } - return ec.___Schema(ctx, field.Selections, res) + + return ec._Repository(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { - args := map[string]interface{}{} - var arg0 string - if tmp, ok := field.Args["name"]; ok { - var err error - arg0, err = graphql.UnmarshalString(tmp) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } + rawArgs := field.ArgumentMap(ec.Variables) + args, err := field_Query___type_args(rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null } - args["name"] = arg0 - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "Query" - rctx.Args = args - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := ec.introspectType(args["name"].(string)) + rctx := &graphql.ResolverContext{ + Object: "Query", + Args: args, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, nil, func(ctx context.Context) (interface{}, error) { + return ec.introspectType(args["name"].(string)), nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + rctx.Result = res + if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow +func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "Query", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, nil, func(ctx context.Context) (interface{}, error) { + return ec.introspectSchema(), nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Schema) + rctx.Result = res + + if res == nil { + return graphql.Null + } + + return ec.___Schema(ctx, field.Selections, res) +} + var repositoryImplementors = []string{"Repository"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _Repository(ctx context.Context, sel []query.Selection, obj *models.Repository) graphql.Marshaler { - fields := graphql.CollectFields(ec.Doc, sel, repositoryImplementors, ec.Variables) +func (ec *executionContext) _Repository(ctx context.Context, sel ast.SelectionSet, obj *models.Repository) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, repositoryImplementors) + var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) + invalid := false for i, field := range fields { out.Keys[i] = field.Alias @@ -2175,174 +3803,99 @@ func (ec *executionContext) _Repository(ctx context.Context, sel []query.Selecti case "__typename": out.Values[i] = graphql.MarshalString("Repository") case "allBugs": - out.Values[i] = ec._Repository_allBugs(ctx, field, obj) + wg.Add(1) + go func(i int, field graphql.CollectedField) { + out.Values[i] = ec._Repository_allBugs(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + wg.Done() + }(i, field) case "bug": - out.Values[i] = ec._Repository_bug(ctx, field, obj) + wg.Add(1) + go func(i int, field graphql.CollectedField) { + out.Values[i] = ec._Repository_bug(ctx, field, obj) + wg.Done() + }(i, field) default: panic("unknown field " + strconv.Quote(field.Name)) } } - + wg.Wait() + if invalid { + return graphql.Null + } return out } +// nolint: vetshadow func (ec *executionContext) _Repository_allBugs(ctx context.Context, field graphql.CollectedField, obj *models.Repository) graphql.Marshaler { - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := field.Args["after"]; ok { - var err error - var ptr1 string - if tmp != nil { - ptr1, err = graphql.UnmarshalString(tmp) - arg0 = &ptr1 - } - - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - } - args["after"] = arg0 - var arg1 *string - if tmp, ok := field.Args["before"]; ok { - var err error - var ptr1 string - if tmp != nil { - ptr1, err = graphql.UnmarshalString(tmp) - arg1 = &ptr1 - } - - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - } - args["before"] = arg1 - var arg2 *int - if tmp, ok := field.Args["first"]; ok { - var err error - var ptr1 int - if tmp != nil { - ptr1, err = graphql.UnmarshalInt(tmp) - arg2 = &ptr1 - } - - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - } - args["first"] = arg2 - var arg3 *int - if tmp, ok := field.Args["last"]; ok { - var err error - var ptr1 int - if tmp != nil { - ptr1, err = graphql.UnmarshalInt(tmp) - arg3 = &ptr1 - } - - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - } - args["last"] = arg3 - var arg4 *string - if tmp, ok := field.Args["query"]; ok { - var err error - var ptr1 string - if tmp != nil { - ptr1, err = graphql.UnmarshalString(tmp) - arg4 = &ptr1 - } - - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } + rawArgs := field.ArgumentMap(ec.Variables) + args, err := field_Repository_allBugs_args(rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null } - args["query"] = arg4 - ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ + rctx := &graphql.ResolverContext{ Object: "Repository", Args: args, Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.Repository().AllBugs(ctx, obj, args["after"].(*string), args["before"].(*string), args["first"].(*int), args["last"].(*int), args["query"].(*string)) }) - return graphql.Defer(func() (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - userErr := ec.Recover(ctx, r) - ec.Error(ctx, userErr) - ret = graphql.Null - } - }() - - resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.Repository_allBugs(ctx, obj, args["after"].(*string), args["before"].(*string), args["first"].(*int), args["last"].(*int), args["query"].(*string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } - res := resTmp.(models.BugConnection) - return ec._BugConnection(ctx, field.Selections, &res) - }) + return graphql.Null + } + res := resTmp.(models.BugConnection) + rctx.Result = res + + return ec._BugConnection(ctx, field.Selections, &res) } +// nolint: vetshadow func (ec *executionContext) _Repository_bug(ctx context.Context, field graphql.CollectedField, obj *models.Repository) graphql.Marshaler { - args := map[string]interface{}{} - var arg0 string - if tmp, ok := field.Args["prefix"]; ok { - var err error - arg0, err = graphql.UnmarshalString(tmp) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } + rawArgs := field.ArgumentMap(ec.Variables) + args, err := field_Repository_bug_args(rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null } - args["prefix"] = arg0 - ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ + rctx := &graphql.ResolverContext{ Object: "Repository", Args: args, Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.Repository().Bug(ctx, obj, args["prefix"].(string)) }) - return graphql.Defer(func() (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - userErr := ec.Recover(ctx, r) - ec.Error(ctx, userErr) - ret = graphql.Null - } - }() + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*bug.Snapshot) + rctx.Result = res - resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.Repository_bug(ctx, obj, args["prefix"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*bug.Snapshot) - if res == nil { - return graphql.Null - } - return ec._Bug(ctx, field.Selections, res) - }) + if res == nil { + return graphql.Null + } + + return ec._Bug(ctx, field.Selections, res) } var setStatusOperationImplementors = []string{"SetStatusOperation", "Operation", "Authored"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _SetStatusOperation(ctx context.Context, sel []query.Selection, obj *operations.SetStatusOperation) graphql.Marshaler { - fields := graphql.CollectFields(ec.Doc, sel, setStatusOperationImplementors, ec.Variables) +func (ec *executionContext) _SetStatusOperation(ctx context.Context, sel ast.SelectionSet, obj *operations.SetStatusOperation) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, setStatusOperationImplementors) + var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) + invalid := false for i, field := range fields { out.Keys[i] = field.Alias @@ -2351,96 +3904,114 @@ func (ec *executionContext) _SetStatusOperation(ctx context.Context, sel []query out.Values[i] = graphql.MarshalString("SetStatusOperation") case "author": out.Values[i] = ec._SetStatusOperation_author(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "date": - out.Values[i] = ec._SetStatusOperation_date(ctx, field, obj) + wg.Add(1) + go func(i int, field graphql.CollectedField) { + out.Values[i] = ec._SetStatusOperation_date(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + wg.Done() + }(i, field) case "status": - out.Values[i] = ec._SetStatusOperation_status(ctx, field, obj) + wg.Add(1) + go func(i int, field graphql.CollectedField) { + out.Values[i] = ec._SetStatusOperation_status(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + wg.Done() + }(i, field) default: panic("unknown field " + strconv.Quote(field.Name)) } } - + wg.Wait() + if invalid { + return graphql.Null + } return out } +// nolint: vetshadow func (ec *executionContext) _SetStatusOperation_author(ctx context.Context, field graphql.CollectedField, obj *operations.SetStatusOperation) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "SetStatusOperation" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Author + rctx := &graphql.ResolverContext{ + Object: "SetStatusOperation", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Author, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bug.Person) + rctx.Result = res + return ec._Person(ctx, field.Selections, &res) } +// nolint: vetshadow func (ec *executionContext) _SetStatusOperation_date(ctx context.Context, field graphql.CollectedField, obj *operations.SetStatusOperation) graphql.Marshaler { - ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ + rctx := &graphql.ResolverContext{ Object: "SetStatusOperation", Args: nil, Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.SetStatusOperation().Date(ctx, obj) }) - return graphql.Defer(func() (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - userErr := ec.Recover(ctx, r) - ec.Error(ctx, userErr) - ret = graphql.Null - } - }() - - resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.SetStatusOperation_date(ctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } - res := resTmp.(time.Time) - return graphql.MarshalTime(res) - }) + return graphql.Null + } + res := resTmp.(time.Time) + rctx.Result = res + return graphql.MarshalTime(res) } +// nolint: vetshadow func (ec *executionContext) _SetStatusOperation_status(ctx context.Context, field graphql.CollectedField, obj *operations.SetStatusOperation) graphql.Marshaler { - ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ + rctx := &graphql.ResolverContext{ Object: "SetStatusOperation", Args: nil, Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.SetStatusOperation().Status(ctx, obj) }) - return graphql.Defer(func() (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - userErr := ec.Recover(ctx, r) - ec.Error(ctx, userErr) - ret = graphql.Null - } - }() - - resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.SetStatusOperation_status(ctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } - res := resTmp.(models.Status) - return res - }) + return graphql.Null + } + res := resTmp.(models.Status) + rctx.Result = res + return res } var setTitleOperationImplementors = []string{"SetTitleOperation", "Operation", "Authored"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _SetTitleOperation(ctx context.Context, sel []query.Selection, obj *operations.SetTitleOperation) graphql.Marshaler { - fields := graphql.CollectFields(ec.Doc, sel, setTitleOperationImplementors, ec.Variables) +func (ec *executionContext) _SetTitleOperation(ctx context.Context, sel ast.SelectionSet, obj *operations.SetTitleOperation) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, setTitleOperationImplementors) + var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) + invalid := false for i, field := range fields { out.Keys[i] = field.Alias @@ -2449,90 +4020,136 @@ func (ec *executionContext) _SetTitleOperation(ctx context.Context, sel []query. out.Values[i] = graphql.MarshalString("SetTitleOperation") case "author": out.Values[i] = ec._SetTitleOperation_author(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "date": - out.Values[i] = ec._SetTitleOperation_date(ctx, field, obj) + wg.Add(1) + go func(i int, field graphql.CollectedField) { + out.Values[i] = ec._SetTitleOperation_date(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + wg.Done() + }(i, field) case "title": out.Values[i] = ec._SetTitleOperation_title(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "was": out.Values[i] = ec._SetTitleOperation_was(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } default: panic("unknown field " + strconv.Quote(field.Name)) } } - + wg.Wait() + if invalid { + return graphql.Null + } return out } +// nolint: vetshadow func (ec *executionContext) _SetTitleOperation_author(ctx context.Context, field graphql.CollectedField, obj *operations.SetTitleOperation) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "SetTitleOperation" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Author + rctx := &graphql.ResolverContext{ + Object: "SetTitleOperation", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Author, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bug.Person) + rctx.Result = res + return ec._Person(ctx, field.Selections, &res) } +// nolint: vetshadow func (ec *executionContext) _SetTitleOperation_date(ctx context.Context, field graphql.CollectedField, obj *operations.SetTitleOperation) graphql.Marshaler { - ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ + rctx := &graphql.ResolverContext{ Object: "SetTitleOperation", Args: nil, Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.SetTitleOperation().Date(ctx, obj) }) - return graphql.Defer(func() (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - userErr := ec.Recover(ctx, r) - ec.Error(ctx, userErr) - ret = graphql.Null - } - }() - - resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.SetTitleOperation_date(ctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } - res := resTmp.(time.Time) - return graphql.MarshalTime(res) - }) + return graphql.Null + } + res := resTmp.(time.Time) + rctx.Result = res + return graphql.MarshalTime(res) } +// nolint: vetshadow func (ec *executionContext) _SetTitleOperation_title(ctx context.Context, field graphql.CollectedField, obj *operations.SetTitleOperation) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "SetTitleOperation" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Title + rctx := &graphql.ResolverContext{ + Object: "SetTitleOperation", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Title, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _SetTitleOperation_was(ctx context.Context, field graphql.CollectedField, obj *operations.SetTitleOperation) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "SetTitleOperation" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Was + rctx := &graphql.ResolverContext{ + Object: "SetTitleOperation", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Was, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } var __DirectiveImplementors = []string{"__Directive"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) ___Directive(ctx context.Context, sel []query.Selection, obj *introspection.Directive) graphql.Marshaler { - fields := graphql.CollectFields(ec.Doc, sel, __DirectiveImplementors, ec.Variables) +func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, __DirectiveImplementors) out := graphql.NewOrderedMap(len(fields)) + invalid := false for i, field := range fields { out.Keys[i] = field.Alias @@ -2541,92 +4158,167 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel []query.Select out.Values[i] = graphql.MarshalString("__Directive") case "name": out.Values[i] = ec.___Directive_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "description": out.Values[i] = ec.___Directive_description(ctx, field, obj) case "locations": out.Values[i] = ec.___Directive_locations(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "args": out.Values[i] = ec.___Directive_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } default: panic("unknown field " + strconv.Quote(field.Name)) } } + if invalid { + return graphql.Null + } return out } +// nolint: vetshadow func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__Directive" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Name() + rctx := &graphql.ResolverContext{ + Object: "__Directive", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Name, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__Directive" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Description() - if res == nil { + rctx := &graphql.ResolverContext{ + Object: "__Directive", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Description, nil + }) + if resTmp == nil { return graphql.Null } - return graphql.MarshalString(*res) + res := resTmp.(string) + rctx.Result = res + return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__Directive" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Locations() - arr1 := graphql.Array{} + rctx := &graphql.ResolverContext{ + Object: "__Directive", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Locations, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]string) + rctx.Result = res + + arr1 := make(graphql.Array, len(res)) + for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + arr1[idx1] = func() graphql.Marshaler { return graphql.MarshalString(res[idx1]) - }()) + }() } + return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__Directive" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Args() - arr1 := graphql.Array{} + rctx := &graphql.ResolverContext{ + Object: "__Directive", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Args, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + rctx.Result = res + + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup + + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } + for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() + } + arr1[idx1] = func() graphql.Marshaler { + + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() + } + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + } + wg.Wait() return arr1 } var __EnumValueImplementors = []string{"__EnumValue"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) ___EnumValue(ctx context.Context, sel []query.Selection, obj *introspection.EnumValue) graphql.Marshaler { - fields := graphql.CollectFields(ec.Doc, sel, __EnumValueImplementors, ec.Variables) +func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, __EnumValueImplementors) out := graphql.NewOrderedMap(len(fields)) + invalid := false for i, field := range fields { out.Keys[i] = field.Alias @@ -2635,10 +4327,16 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel []query.Select out.Values[i] = graphql.MarshalString("__EnumValue") case "name": out.Values[i] = ec.___EnumValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "description": out.Values[i] = ec.___EnumValue_description(ctx, field, obj) case "isDeprecated": out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "deprecationReason": out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) default: @@ -2646,66 +4344,102 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel []query.Select } } + if invalid { + return graphql.Null + } return out } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__EnumValue" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Name() + rctx := &graphql.ResolverContext{ + Object: "__EnumValue", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Name, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__EnumValue" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Description() - if res == nil { + rctx := &graphql.ResolverContext{ + Object: "__EnumValue", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Description, nil + }) + if resTmp == nil { return graphql.Null } - return graphql.MarshalString(*res) + res := resTmp.(string) + rctx.Result = res + return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__EnumValue" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.IsDeprecated() + rctx := &graphql.ResolverContext{ + Object: "__EnumValue", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.IsDeprecated, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__EnumValue" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.DeprecationReason() - if res == nil { + rctx := &graphql.ResolverContext{ + Object: "__EnumValue", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.DeprecationReason, nil + }) + if resTmp == nil { return graphql.Null } - return graphql.MarshalString(*res) + res := resTmp.(string) + rctx.Result = res + return graphql.MarshalString(res) } var __FieldImplementors = []string{"__Field"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) ___Field(ctx context.Context, sel []query.Selection, obj *introspection.Field) graphql.Marshaler { - fields := graphql.CollectFields(ec.Doc, sel, __FieldImplementors, ec.Variables) +func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, __FieldImplementors) out := graphql.NewOrderedMap(len(fields)) + invalid := false for i, field := range fields { out.Keys[i] = field.Alias @@ -2714,14 +4448,26 @@ func (ec *executionContext) ___Field(ctx context.Context, sel []query.Selection, out.Values[i] = graphql.MarshalString("__Field") case "name": out.Values[i] = ec.___Field_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "description": out.Values[i] = ec.___Field_description(ctx, field, obj) case "args": out.Values[i] = ec.___Field_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "type": out.Values[i] = ec.___Field_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "isDeprecated": out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "deprecationReason": out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) default: @@ -2729,97 +4475,187 @@ func (ec *executionContext) ___Field(ctx context.Context, sel []query.Selection, } } + if invalid { + return graphql.Null + } return out } +// nolint: vetshadow func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__Field" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Name() + rctx := &graphql.ResolverContext{ + Object: "__Field", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Name, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__Field" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Description() - if res == nil { + rctx := &graphql.ResolverContext{ + Object: "__Field", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Description, nil + }) + if resTmp == nil { return graphql.Null } - return graphql.MarshalString(*res) + res := resTmp.(string) + rctx.Result = res + return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__Field" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Args() - arr1 := graphql.Array{} + rctx := &graphql.ResolverContext{ + Object: "__Field", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Args, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + rctx.Result = res + + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup + + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } + for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() + } + arr1[idx1] = func() graphql.Marshaler { + + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() + } + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + } + wg.Wait() return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__Field" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Type() - return ec.___Type(ctx, field.Selections, &res) + rctx := &graphql.ResolverContext{ + Object: "__Field", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Type, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + rctx.Result = res + + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__Field" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.IsDeprecated() + rctx := &graphql.ResolverContext{ + Object: "__Field", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.IsDeprecated, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__Field" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.DeprecationReason() - if res == nil { + rctx := &graphql.ResolverContext{ + Object: "__Field", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.DeprecationReason, nil + }) + if resTmp == nil { return graphql.Null } - return graphql.MarshalString(*res) + res := resTmp.(string) + rctx.Result = res + return graphql.MarshalString(res) } var __InputValueImplementors = []string{"__InputValue"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) ___InputValue(ctx context.Context, sel []query.Selection, obj *introspection.InputValue) graphql.Marshaler { - fields := graphql.CollectFields(ec.Doc, sel, __InputValueImplementors, ec.Variables) +func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, __InputValueImplementors) out := graphql.NewOrderedMap(len(fields)) + invalid := false for i, field := range fields { out.Keys[i] = field.Alias @@ -2828,10 +4664,16 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel []query.Selec out.Values[i] = graphql.MarshalString("__InputValue") case "name": out.Values[i] = ec.___InputValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "description": out.Values[i] = ec.___InputValue_description(ctx, field, obj) case "type": out.Values[i] = ec.___InputValue_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "defaultValue": out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) default: @@ -2839,53 +4681,100 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel []query.Selec } } + if invalid { + return graphql.Null + } return out } +// nolint: vetshadow func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__InputValue" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Name() + rctx := &graphql.ResolverContext{ + Object: "__InputValue", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Name, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__InputValue" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Description() - if res == nil { + rctx := &graphql.ResolverContext{ + Object: "__InputValue", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Description, nil + }) + if resTmp == nil { return graphql.Null } - return graphql.MarshalString(*res) + res := resTmp.(string) + rctx.Result = res + return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__InputValue" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Type() - return ec.___Type(ctx, field.Selections, &res) + rctx := &graphql.ResolverContext{ + Object: "__InputValue", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Type, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + rctx.Result = res + + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__InputValue" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.DefaultValue() + rctx := &graphql.ResolverContext{ + Object: "__InputValue", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.DefaultValue, nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + rctx.Result = res + if res == nil { return graphql.Null } @@ -2895,10 +4784,11 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel var __SchemaImplementors = []string{"__Schema"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) ___Schema(ctx context.Context, sel []query.Selection, obj *introspection.Schema) graphql.Marshaler { - fields := graphql.CollectFields(ec.Doc, sel, __SchemaImplementors, ec.Variables) +func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, __SchemaImplementors) out := graphql.NewOrderedMap(len(fields)) + invalid := false for i, field := range fields { out.Keys[i] = field.Alias @@ -2907,108 +4797,230 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel []query.Selection out.Values[i] = graphql.MarshalString("__Schema") case "types": out.Values[i] = ec.___Schema_types(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "queryType": out.Values[i] = ec.___Schema_queryType(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "mutationType": out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) case "subscriptionType": out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) case "directives": out.Values[i] = ec.___Schema_directives(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } default: panic("unknown field " + strconv.Quote(field.Name)) } } + if invalid { + return graphql.Null + } return out } +// nolint: vetshadow func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__Schema" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Types() - arr1 := graphql.Array{} + rctx := &graphql.ResolverContext{ + Object: "__Schema", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Types(), nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Type) + rctx.Result = res + + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup + + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } + for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() - return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() + } + arr1[idx1] = func() graphql.Marshaler { + + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() + } + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + } + wg.Wait() return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__Schema" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.QueryType() - return ec.___Type(ctx, field.Selections, &res) + rctx := &graphql.ResolverContext{ + Object: "__Schema", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.QueryType(), nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + rctx.Result = res + + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__Schema" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.MutationType() + rctx := &graphql.ResolverContext{ + Object: "__Schema", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.MutationType(), nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + rctx.Result = res + if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__Schema" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.SubscriptionType() + rctx := &graphql.ResolverContext{ + Object: "__Schema", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.SubscriptionType(), nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + rctx.Result = res + if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__Schema" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Directives() - arr1 := graphql.Array{} + rctx := &graphql.ResolverContext{ + Object: "__Schema", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Directives(), nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Directive) + rctx.Result = res + + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup + + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } + for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() - return ec.___Directive(ctx, field.Selections, &res[idx1]) - }()) + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() + } + arr1[idx1] = func() graphql.Marshaler { + + return ec.___Directive(ctx, field.Selections, &res[idx1]) + }() + } + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + } + wg.Wait() return arr1 } var __TypeImplementors = []string{"__Type"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) ___Type(ctx context.Context, sel []query.Selection, obj *introspection.Type) graphql.Marshaler { - fields := graphql.CollectFields(ec.Doc, sel, __TypeImplementors, ec.Variables) +func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, __TypeImplementors) out := graphql.NewOrderedMap(len(fields)) + invalid := false for i, field := range fields { out.Keys[i] = field.Alias @@ -3017,6 +5029,9 @@ func (ec *executionContext) ___Type(ctx context.Context, sel []query.Selection, out.Values[i] = graphql.MarshalString("__Type") case "kind": out.Values[i] = ec.___Type_kind(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "name": out.Values[i] = ec.___Type_name(ctx, field, obj) case "description": @@ -3038,185 +5053,373 @@ func (ec *executionContext) ___Type(ctx context.Context, sel []query.Selection, } } + if invalid { + return graphql.Null + } return out } +// nolint: vetshadow func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__Type" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Kind() + rctx := &graphql.ResolverContext{ + Object: "__Type", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Kind(), nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__Type" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Name() + rctx := &graphql.ResolverContext{ + Object: "__Type", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Name(), nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + rctx.Result = res + if res == nil { return graphql.Null } return graphql.MarshalString(*res) } +// nolint: vetshadow func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__Type" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Description() - if res == nil { + rctx := &graphql.ResolverContext{ + Object: "__Type", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Description(), nil + }) + if resTmp == nil { return graphql.Null } - return graphql.MarshalString(*res) + res := resTmp.(string) + rctx.Result = res + return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { - args := map[string]interface{}{} - var arg0 bool - if tmp, ok := field.Args["includeDeprecated"]; ok { - var err error - arg0, err = graphql.UnmarshalBoolean(tmp) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } + rawArgs := field.ArgumentMap(ec.Variables) + args, err := field___Type_fields_args(rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null } - args["includeDeprecated"] = arg0 - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__Type" - rctx.Args = args - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Fields(args["includeDeprecated"].(bool)) - arr1 := graphql.Array{} + rctx := &graphql.ResolverContext{ + Object: "__Type", + Args: args, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Fields(args["includeDeprecated"].(bool)), nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Field) + rctx.Result = res + + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup + + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } + for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() - return ec.___Field(ctx, field.Selections, &res[idx1]) - }()) + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() + } + arr1[idx1] = func() graphql.Marshaler { + + return ec.___Field(ctx, field.Selections, &res[idx1]) + }() + } + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + } + wg.Wait() return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__Type" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.Interfaces() - arr1 := graphql.Array{} + rctx := &graphql.ResolverContext{ + Object: "__Type", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Interfaces(), nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + rctx.Result = res + + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup + + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } + for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() - return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() + } + arr1[idx1] = func() graphql.Marshaler { + + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() + } + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + } + wg.Wait() return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__Type" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.PossibleTypes() - arr1 := graphql.Array{} + rctx := &graphql.ResolverContext{ + Object: "__Type", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.PossibleTypes(), nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + rctx.Result = res + + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup + + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } + for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() - return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() + } + arr1[idx1] = func() graphql.Marshaler { + + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() + } + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + } + wg.Wait() return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { - args := map[string]interface{}{} - var arg0 bool - if tmp, ok := field.Args["includeDeprecated"]; ok { - var err error - arg0, err = graphql.UnmarshalBoolean(tmp) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } + rawArgs := field.ArgumentMap(ec.Variables) + args, err := field___Type_enumValues_args(rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null } - args["includeDeprecated"] = arg0 - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__Type" - rctx.Args = args - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.EnumValues(args["includeDeprecated"].(bool)) - arr1 := graphql.Array{} + rctx := &graphql.ResolverContext{ + Object: "__Type", + Args: args, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.EnumValues(args["includeDeprecated"].(bool)), nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.EnumValue) + rctx.Result = res + + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup + + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } + for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() - return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }()) + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() + } + arr1[idx1] = func() graphql.Marshaler { + + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) + }() + } + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + } + wg.Wait() return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__Type" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.InputFields() - arr1 := graphql.Array{} + rctx := &graphql.ResolverContext{ + Object: "__Type", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.InputFields(), nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + rctx.Result = res + + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup + + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } + for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() + } + arr1[idx1] = func() graphql.Marshaler { + + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() + } + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + } + wg.Wait() return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.Object = "__Type" - rctx.Args = nil - rctx.Field = field - rctx.PushField(field.Alias) - defer rctx.Pop() - res := obj.OfType() + rctx := &graphql.ResolverContext{ + Object: "__Type", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.OfType(), nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + rctx.Result = res + if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -func (ec *executionContext) _Authored(ctx context.Context, sel []query.Selection, obj *models.Authored) graphql.Marshaler { +func (ec *executionContext) _Authored(ctx context.Context, sel ast.SelectionSet, obj *models.Authored) graphql.Marshaler { switch obj := (*obj).(type) { case nil: return graphql.Null @@ -3249,7 +5452,7 @@ func (ec *executionContext) _Authored(ctx context.Context, sel []query.Selection } } -func (ec *executionContext) _Operation(ctx context.Context, sel []query.Selection, obj *bug.Operation) graphql.Marshaler { +func (ec *executionContext) _Operation(ctx context.Context, sel ast.SelectionSet, obj *bug.Operation) graphql.Marshaler { switch obj := (*obj).(type) { case nil: return graphql.Null @@ -3278,40 +5481,52 @@ func (ec *executionContext) _Operation(ctx context.Context, sel []query.Selectio } } +func (ec *executionContext) FieldMiddleware(ctx context.Context, obj interface{}, next graphql.Resolver) (ret interface{}) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + res, err := ec.ResolverMiddleware(ctx, next) + if err != nil { + ec.Error(ctx, err) + return nil + } + return res +} + func (ec *executionContext) introspectSchema() *introspection.Schema { return introspection.WrapSchema(parsedSchema) } func (ec *executionContext) introspectType(name string) *introspection.Type { - t := parsedSchema.Resolve(name) - if t == nil { - return nil - } - return introspection.WrapType(t) + return introspection.WrapTypeFromDef(parsedSchema, parsedSchema.Types[name]) } -var parsedSchema = schema.MustParse(`scalar Time +var parsedSchema = gqlparser.MustLoadSchema( + &ast.Source{Name: "schema.graphql", Input: `scalar Time scalar Label scalar Hash -# Information about pagination in a connection. +"""Information about pagination in a connection.""" type PageInfo { - # When paginating forwards, are there more items? + """When paginating forwards, are there more items?""" hasNextPage: Boolean! - # When paginating backwards, are there more items? + """When paginating backwards, are there more items?""" hasPreviousPage: Boolean! - # When paginating backwards, the cursor to continue. + """When paginating backwards, the cursor to continue.""" startCursor: String! - # When paginating forwards, the cursor to continue. + """When paginating forwards, the cursor to continue.""" endCursor: String! } -# Represents an person in a git object. +"""Represents an person in a git object.""" type Person { - # The email of the person. + """The email of the person.""" email: String - # The name of the person. + """The name of the person.""" name: String } @@ -3327,15 +5542,15 @@ type CommentEdge { node: Comment! } -# Represents a comment on a bug. +"""Represents a comment on a bug.""" type Comment implements Authored { - # The author of this comment. + """The author of this comment.""" author: Person! - # The message of this comment. + """The message of this comment.""" message: String! - # All media's hash referenced in this comment + """All media's hash referenced in this comment""" files: [Hash!]! } @@ -3344,9 +5559,9 @@ enum Status { CLOSED } -# An object that has an author. +"""An object that has an author.""" interface Authored { - # The author of this object. + """The author of this object.""" author: Person! } @@ -3362,15 +5577,15 @@ type OperationEdge { node: Operation! } -# An operation applied to a bug. +"""An operation applied to a bug.""" interface Operation { - # The operations author. + """The operations author.""" author: Person! - # The datetime when this operation was issued. + """The datetime when this operation was issued.""" date: Time! } -type CreateOperation implements Operation, Authored { +type CreateOperation implements Operation & Authored { author: Person! date: Time! @@ -3379,7 +5594,7 @@ type CreateOperation implements Operation, Authored { files: [Hash!]! } -type SetTitleOperation implements Operation, Authored { +type SetTitleOperation implements Operation & Authored { author: Person! date: Time! @@ -3387,7 +5602,7 @@ type SetTitleOperation implements Operation, Authored { was: String! } -type AddCommentOperation implements Operation, Authored { +type AddCommentOperation implements Operation & Authored { author: Person! date: Time! @@ -3395,14 +5610,14 @@ type AddCommentOperation implements Operation, Authored { files: [Hash!]! } -type SetStatusOperation implements Operation, Authored { +type SetStatusOperation implements Operation & Authored { author: Person! date: Time! status: Status! } -type LabelChangeOperation implements Operation, Authored { +type LabelChangeOperation implements Operation & Authored { author: Person! date: Time! @@ -3410,22 +5625,22 @@ type LabelChangeOperation implements Operation, Authored { removed: [Label!]! } -# The connection type for Bug. +"""The connection type for Bug.""" type BugConnection { - # A list of edges. + """A list of edges.""" edges: [BugEdge!]! nodes: [Bug!]! - # Information to aid in pagination. + """Information to aid in pagination.""" pageInfo: PageInfo! - # Identifies the total count of items in the connection. + """Identifies the total count of items in the connection.""" totalCount: Int! } -# An edge in a connection. +"""An edge in a connection.""" type BugEdge { - # A cursor for use in pagination. + """A cursor for use in pagination.""" cursor: String! - # The item at the end of the edge. + """The item at the end of the edge.""" node: Bug! } @@ -3440,39 +5655,39 @@ type Bug { lastEdit: Time! comments( - # Returns the elements in the list that come after the specified cursor. + """Returns the elements in the list that come after the specified cursor.""" after: String - # Returns the elements in the list that come before the specified cursor. + """Returns the elements in the list that come before the specified cursor.""" before: String - # Returns the first _n_ elements from the list. + """Returns the first _n_ elements from the list.""" first: Int - # Returns the last _n_ elements from the list. + """Returns the last _n_ elements from the list.""" last: Int ): CommentConnection! operations( - # Returns the elements in the list that come after the specified cursor. + """Returns the elements in the list that come after the specified cursor.""" after: String - # Returns the elements in the list that come before the specified cursor. + """Returns the elements in the list that come before the specified cursor.""" before: String - # Returns the first _n_ elements from the list. + """Returns the first _n_ elements from the list.""" first: Int - # Returns the last _n_ elements from the list. + """Returns the last _n_ elements from the list.""" last: Int ): OperationConnection! } type Repository { allBugs( - # Returns the elements in the list that come after the specified cursor. + """Returns the elements in the list that come after the specified cursor.""" after: String - # Returns the elements in the list that come before the specified cursor. + """Returns the elements in the list that come before the specified cursor.""" before: String - # Returns the first _n_ elements from the list. + """Returns the first _n_ elements from the list.""" first: Int - # Returns the last _n_ elements from the list. + """Returns the last _n_ elements from the list.""" last: Int - # A query to select and order bugs + """A query to select and order bugs""" query: String ): BugConnection! bug(prefix: String!): Bug @@ -3494,4 +5709,5 @@ type Mutation { commit(repoRef: String, prefix: String!): Bug! } -`) +`}, +) -- cgit