diff options
Diffstat (limited to 'graphql/graph/gen_graph.go')
-rw-r--r-- | graphql/graph/gen_graph.go | 1592 |
1 files changed, 1529 insertions, 63 deletions
diff --git a/graphql/graph/gen_graph.go b/graphql/graph/gen_graph.go index 95a15499..01e3bb91 100644 --- a/graphql/graph/gen_graph.go +++ b/graphql/graph/gen_graph.go @@ -14,7 +14,6 @@ import ( 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" gqlparser "github.com/vektah/gqlparser" ast "github.com/vektah/gqlparser/ast" @@ -38,7 +37,10 @@ type Config struct { type ResolverRoot interface { AddCommentOperation() AddCommentOperationResolver Bug() BugResolver + CommentHistoryStep() CommentHistoryStepResolver + CommentTimelineItem() CommentTimelineItemResolver CreateOperation() CreateOperationResolver + CreateTimelineItem() CreateTimelineItemResolver LabelChangeOperation() LabelChangeOperationResolver Mutation() MutationResolver Query() QueryResolver @@ -68,6 +70,7 @@ type ComplexityRoot struct { CreatedAt func(childComplexity int) int LastEdit func(childComplexity int) int Comments func(childComplexity int, after *string, before *string, first *int, last *int) int + Timeline 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 } @@ -101,6 +104,22 @@ type ComplexityRoot struct { Node func(childComplexity int) int } + CommentHistoryStep struct { + Message func(childComplexity int) int + Date func(childComplexity int) int + } + + CommentTimelineItem struct { + Hash func(childComplexity int) int + Author func(childComplexity int) int + Message func(childComplexity int) int + Files func(childComplexity int) int + CreatedAt func(childComplexity int) int + LastEdit func(childComplexity int) int + Edited func(childComplexity int) int + History func(childComplexity int) int + } + CreateOperation struct { Author func(childComplexity int) int Date func(childComplexity int) int @@ -109,7 +128,19 @@ type ComplexityRoot struct { Files func(childComplexity int) int } + CreateTimelineItem struct { + Hash func(childComplexity int) int + Author func(childComplexity int) int + Message func(childComplexity int) int + Files func(childComplexity int) int + CreatedAt func(childComplexity int) int + LastEdit func(childComplexity int) int + Edited func(childComplexity int) int + History func(childComplexity int) int + } + LabelChangeOperation struct { + Hash func(childComplexity int) int Author func(childComplexity int) int Date func(childComplexity int) int Added func(childComplexity int) int @@ -162,37 +193,63 @@ type ComplexityRoot struct { } SetStatusOperation struct { + Hash func(childComplexity int) int Author func(childComplexity int) int Date func(childComplexity int) int Status func(childComplexity int) int } SetTitleOperation struct { + Hash func(childComplexity int) int Author func(childComplexity int) int Date func(childComplexity int) int Title func(childComplexity int) int Was func(childComplexity int) int } + + TimelineItemConnection struct { + Edges func(childComplexity int) int + Nodes func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + TimelineItemEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } } type AddCommentOperationResolver interface { - Author(ctx context.Context, obj *operations.AddCommentOperation) (bug.Person, error) - Date(ctx context.Context, obj *operations.AddCommentOperation) (time.Time, error) + Author(ctx context.Context, obj *bug.AddCommentOperation) (bug.Person, error) + Date(ctx context.Context, obj *bug.AddCommentOperation) (time.Time, error) } type BugResolver interface { Status(ctx context.Context, obj *bug.Snapshot) (models.Status, error) LastEdit(ctx context.Context, obj *bug.Snapshot) (time.Time, error) Comments(ctx context.Context, obj *bug.Snapshot, after *string, before *string, first *int, last *int) (models.CommentConnection, error) + Timeline(ctx context.Context, obj *bug.Snapshot, after *string, before *string, first *int, last *int) (models.TimelineItemConnection, error) Operations(ctx context.Context, obj *bug.Snapshot, after *string, before *string, first *int, last *int) (models.OperationConnection, error) } +type CommentHistoryStepResolver interface { + Date(ctx context.Context, obj *bug.CommentHistoryStep) (time.Time, error) +} +type CommentTimelineItemResolver interface { + CreatedAt(ctx context.Context, obj *bug.CommentTimelineItem) (time.Time, error) + LastEdit(ctx context.Context, obj *bug.CommentTimelineItem) (time.Time, error) +} type CreateOperationResolver interface { - Author(ctx context.Context, obj *operations.CreateOperation) (bug.Person, error) - Date(ctx context.Context, obj *operations.CreateOperation) (time.Time, error) + Author(ctx context.Context, obj *bug.CreateOperation) (bug.Person, error) + Date(ctx context.Context, obj *bug.CreateOperation) (time.Time, error) +} +type CreateTimelineItemResolver interface { + CreatedAt(ctx context.Context, obj *bug.CreateTimelineItem) (time.Time, error) + LastEdit(ctx context.Context, obj *bug.CreateTimelineItem) (time.Time, error) } type LabelChangeOperationResolver interface { - Author(ctx context.Context, obj *operations.LabelChangeOperation) (bug.Person, error) - Date(ctx context.Context, obj *operations.LabelChangeOperation) (time.Time, error) + Author(ctx context.Context, obj *bug.LabelChangeOperation) (bug.Person, error) + Date(ctx context.Context, obj *bug.LabelChangeOperation) (time.Time, error) } type MutationResolver interface { NewBug(ctx context.Context, repoRef *string, title string, message string, files []git.Hash) (bug.Snapshot, error) @@ -212,13 +269,13 @@ type RepositoryResolver interface { Bug(ctx context.Context, obj *models.Repository, prefix string) (*bug.Snapshot, error) } type SetStatusOperationResolver interface { - Author(ctx context.Context, obj *operations.SetStatusOperation) (bug.Person, error) - Date(ctx context.Context, obj *operations.SetStatusOperation) (time.Time, error) - Status(ctx context.Context, obj *operations.SetStatusOperation) (models.Status, error) + Author(ctx context.Context, obj *bug.SetStatusOperation) (bug.Person, error) + Date(ctx context.Context, obj *bug.SetStatusOperation) (time.Time, error) + Status(ctx context.Context, obj *bug.SetStatusOperation) (models.Status, error) } type SetTitleOperationResolver interface { - Author(ctx context.Context, obj *operations.SetTitleOperation) (bug.Person, error) - Date(ctx context.Context, obj *operations.SetTitleOperation) (time.Time, error) + Author(ctx context.Context, obj *bug.SetTitleOperation) (bug.Person, error) + Date(ctx context.Context, obj *bug.SetTitleOperation) (time.Time, error) } func field_Bug_comments_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { @@ -283,6 +340,68 @@ func field_Bug_comments_args(rawArgs map[string]interface{}) (map[string]interfa } +func field_Bug_timeline_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 + return args, nil + +} + func field_Bug_operations_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { args := map[string]interface{}{} var arg0 *string @@ -915,6 +1034,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Bug.Comments(childComplexity, args["after"].(*string), args["before"].(*string), args["first"].(*int), args["last"].(*int)), true + case "Bug.timeline": + if e.complexity.Bug.Timeline == nil { + break + } + + args, err := field_Bug_timeline_args(rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Bug.Timeline(childComplexity, args["after"].(*string), args["before"].(*string), args["first"].(*int), args["last"].(*int)), true + case "Bug.operations": if e.complexity.Bug.Operations == nil { break @@ -1032,6 +1163,76 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.CommentEdge.Node(childComplexity), true + case "CommentHistoryStep.message": + if e.complexity.CommentHistoryStep.Message == nil { + break + } + + return e.complexity.CommentHistoryStep.Message(childComplexity), true + + case "CommentHistoryStep.date": + if e.complexity.CommentHistoryStep.Date == nil { + break + } + + return e.complexity.CommentHistoryStep.Date(childComplexity), true + + case "CommentTimelineItem.hash": + if e.complexity.CommentTimelineItem.Hash == nil { + break + } + + return e.complexity.CommentTimelineItem.Hash(childComplexity), true + + case "CommentTimelineItem.author": + if e.complexity.CommentTimelineItem.Author == nil { + break + } + + return e.complexity.CommentTimelineItem.Author(childComplexity), true + + case "CommentTimelineItem.message": + if e.complexity.CommentTimelineItem.Message == nil { + break + } + + return e.complexity.CommentTimelineItem.Message(childComplexity), true + + case "CommentTimelineItem.files": + if e.complexity.CommentTimelineItem.Files == nil { + break + } + + return e.complexity.CommentTimelineItem.Files(childComplexity), true + + case "CommentTimelineItem.createdAt": + if e.complexity.CommentTimelineItem.CreatedAt == nil { + break + } + + return e.complexity.CommentTimelineItem.CreatedAt(childComplexity), true + + case "CommentTimelineItem.lastEdit": + if e.complexity.CommentTimelineItem.LastEdit == nil { + break + } + + return e.complexity.CommentTimelineItem.LastEdit(childComplexity), true + + case "CommentTimelineItem.edited": + if e.complexity.CommentTimelineItem.Edited == nil { + break + } + + return e.complexity.CommentTimelineItem.Edited(childComplexity), true + + case "CommentTimelineItem.history": + if e.complexity.CommentTimelineItem.History == nil { + break + } + + return e.complexity.CommentTimelineItem.History(childComplexity), true + case "CreateOperation.author": if e.complexity.CreateOperation.Author == nil { break @@ -1067,6 +1268,69 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.CreateOperation.Files(childComplexity), true + case "CreateTimelineItem.hash": + if e.complexity.CreateTimelineItem.Hash == nil { + break + } + + return e.complexity.CreateTimelineItem.Hash(childComplexity), true + + case "CreateTimelineItem.author": + if e.complexity.CreateTimelineItem.Author == nil { + break + } + + return e.complexity.CreateTimelineItem.Author(childComplexity), true + + case "CreateTimelineItem.message": + if e.complexity.CreateTimelineItem.Message == nil { + break + } + + return e.complexity.CreateTimelineItem.Message(childComplexity), true + + case "CreateTimelineItem.files": + if e.complexity.CreateTimelineItem.Files == nil { + break + } + + return e.complexity.CreateTimelineItem.Files(childComplexity), true + + case "CreateTimelineItem.createdAt": + if e.complexity.CreateTimelineItem.CreatedAt == nil { + break + } + + return e.complexity.CreateTimelineItem.CreatedAt(childComplexity), true + + case "CreateTimelineItem.lastEdit": + if e.complexity.CreateTimelineItem.LastEdit == nil { + break + } + + return e.complexity.CreateTimelineItem.LastEdit(childComplexity), true + + case "CreateTimelineItem.edited": + if e.complexity.CreateTimelineItem.Edited == nil { + break + } + + return e.complexity.CreateTimelineItem.Edited(childComplexity), true + + case "CreateTimelineItem.history": + if e.complexity.CreateTimelineItem.History == nil { + break + } + + return e.complexity.CreateTimelineItem.History(childComplexity), true + + case "LabelChangeOperation.hash": + if e.complexity.LabelChangeOperation.Hash == nil { + break + } + + return e.complexity.LabelChangeOperation.Hash(childComplexity), true + case "LabelChangeOperation.author": if e.complexity.LabelChangeOperation.Author == nil { break @@ -1313,6 +1577,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Repository.Bug(childComplexity, args["prefix"].(string)), true + case "SetStatusOperation.hash": + if e.complexity.SetStatusOperation.Hash == nil { + break + } + + return e.complexity.SetStatusOperation.Hash(childComplexity), true + case "SetStatusOperation.author": if e.complexity.SetStatusOperation.Author == nil { break @@ -1334,6 +1605,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.SetStatusOperation.Status(childComplexity), true + case "SetTitleOperation.hash": + if e.complexity.SetTitleOperation.Hash == nil { + break + } + + return e.complexity.SetTitleOperation.Hash(childComplexity), true + case "SetTitleOperation.author": if e.complexity.SetTitleOperation.Author == nil { break @@ -1362,6 +1640,48 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.SetTitleOperation.Was(childComplexity), true + case "TimelineItemConnection.edges": + if e.complexity.TimelineItemConnection.Edges == nil { + break + } + + return e.complexity.TimelineItemConnection.Edges(childComplexity), true + + case "TimelineItemConnection.nodes": + if e.complexity.TimelineItemConnection.Nodes == nil { + break + } + + return e.complexity.TimelineItemConnection.Nodes(childComplexity), true + + case "TimelineItemConnection.pageInfo": + if e.complexity.TimelineItemConnection.PageInfo == nil { + break + } + + return e.complexity.TimelineItemConnection.PageInfo(childComplexity), true + + case "TimelineItemConnection.totalCount": + if e.complexity.TimelineItemConnection.TotalCount == nil { + break + } + + return e.complexity.TimelineItemConnection.TotalCount(childComplexity), true + + case "TimelineItemEdge.cursor": + if e.complexity.TimelineItemEdge.Cursor == nil { + break + } + + return e.complexity.TimelineItemEdge.Cursor(childComplexity), true + + case "TimelineItemEdge.node": + if e.complexity.TimelineItemEdge.Node == nil { + break + } + + return e.complexity.TimelineItemEdge.Node(childComplexity), true + } return 0, false } @@ -1410,7 +1730,7 @@ type executionContext struct { var addCommentOperationImplementors = []string{"AddCommentOperation", "Operation", "Authored"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _AddCommentOperation(ctx context.Context, sel ast.SelectionSet, obj *operations.AddCommentOperation) graphql.Marshaler { +func (ec *executionContext) _AddCommentOperation(ctx context.Context, sel ast.SelectionSet, obj *bug.AddCommentOperation) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, addCommentOperationImplementors) var wg sync.WaitGroup @@ -1462,7 +1782,7 @@ func (ec *executionContext) _AddCommentOperation(ctx context.Context, sel ast.Se } // nolint: vetshadow -func (ec *executionContext) _AddCommentOperation_author(ctx context.Context, field graphql.CollectedField, obj *operations.AddCommentOperation) graphql.Marshaler { +func (ec *executionContext) _AddCommentOperation_author(ctx context.Context, field graphql.CollectedField, obj *bug.AddCommentOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "AddCommentOperation", Args: nil, @@ -1485,7 +1805,7 @@ func (ec *executionContext) _AddCommentOperation_author(ctx context.Context, fie } // nolint: vetshadow -func (ec *executionContext) _AddCommentOperation_date(ctx context.Context, field graphql.CollectedField, obj *operations.AddCommentOperation) graphql.Marshaler { +func (ec *executionContext) _AddCommentOperation_date(ctx context.Context, field graphql.CollectedField, obj *bug.AddCommentOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "AddCommentOperation", Args: nil, @@ -1507,7 +1827,7 @@ func (ec *executionContext) _AddCommentOperation_date(ctx context.Context, field } // nolint: vetshadow -func (ec *executionContext) _AddCommentOperation_message(ctx context.Context, field graphql.CollectedField, obj *operations.AddCommentOperation) graphql.Marshaler { +func (ec *executionContext) _AddCommentOperation_message(ctx context.Context, field graphql.CollectedField, obj *bug.AddCommentOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "AddCommentOperation", Args: nil, @@ -1529,7 +1849,7 @@ func (ec *executionContext) _AddCommentOperation_message(ctx context.Context, fi } // nolint: vetshadow -func (ec *executionContext) _AddCommentOperation_files(ctx context.Context, field graphql.CollectedField, obj *operations.AddCommentOperation) graphql.Marshaler { +func (ec *executionContext) _AddCommentOperation_files(ctx context.Context, field graphql.CollectedField, obj *bug.AddCommentOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "AddCommentOperation", Args: nil, @@ -1631,6 +1951,15 @@ func (ec *executionContext) _Bug(ctx context.Context, sel ast.SelectionSet, obj } wg.Done() }(i, field) + case "timeline": + wg.Add(1) + go func(i int, field graphql.CollectedField) { + out.Values[i] = ec._Bug_timeline(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + wg.Done() + }(i, field) case "operations": wg.Add(1) go func(i int, field graphql.CollectedField) { @@ -1867,6 +2196,35 @@ func (ec *executionContext) _Bug_comments(ctx context.Context, field graphql.Col } // nolint: vetshadow +func (ec *executionContext) _Bug_timeline(ctx context.Context, field graphql.CollectedField, obj *bug.Snapshot) graphql.Marshaler { + rawArgs := field.ArgumentMap(ec.Variables) + args, err := field_Bug_timeline_args(rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + 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().Timeline(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.TimelineItemConnection) + rctx.Result = res + + return ec._TimelineItemConnection(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) @@ -2571,10 +2929,387 @@ func (ec *executionContext) _CommentEdge_node(ctx context.Context, field graphql return ec._Comment(ctx, field.Selections, &res) } +var commentHistoryStepImplementors = []string{"CommentHistoryStep"} + +// nolint: gocyclo, errcheck, gas, goconst +func (ec *executionContext) _CommentHistoryStep(ctx context.Context, sel ast.SelectionSet, obj *bug.CommentHistoryStep) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, commentHistoryStepImplementors) + + var wg sync.WaitGroup + out := graphql.NewOrderedMap(len(fields)) + invalid := false + for i, field := range fields { + out.Keys[i] = field.Alias + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("CommentHistoryStep") + case "message": + out.Values[i] = ec._CommentHistoryStep_message(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "date": + wg.Add(1) + go func(i int, field graphql.CollectedField) { + out.Values[i] = ec._CommentHistoryStep_date(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) _CommentHistoryStep_message(ctx context.Context, field graphql.CollectedField, obj *bug.CommentHistoryStep) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "CommentHistoryStep", + 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) _CommentHistoryStep_date(ctx context.Context, field graphql.CollectedField, obj *bug.CommentHistoryStep) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "CommentHistoryStep", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.CommentHistoryStep().Date(ctx, obj) + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + rctx.Result = res + return graphql.MarshalTime(res) +} + +var commentTimelineItemImplementors = []string{"CommentTimelineItem", "TimelineItem"} + +// nolint: gocyclo, errcheck, gas, goconst +func (ec *executionContext) _CommentTimelineItem(ctx context.Context, sel ast.SelectionSet, obj *bug.CommentTimelineItem) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, commentTimelineItemImplementors) + + var wg sync.WaitGroup + out := graphql.NewOrderedMap(len(fields)) + invalid := false + for i, field := range fields { + out.Keys[i] = field.Alias + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("CommentTimelineItem") + case "hash": + out.Values[i] = ec._CommentTimelineItem_hash(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "author": + out.Values[i] = ec._CommentTimelineItem_author(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "message": + out.Values[i] = ec._CommentTimelineItem_message(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "files": + out.Values[i] = ec._CommentTimelineItem_files(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "createdAt": + wg.Add(1) + go func(i int, field graphql.CollectedField) { + out.Values[i] = ec._CommentTimelineItem_createdAt(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + wg.Done() + }(i, field) + case "lastEdit": + wg.Add(1) + go func(i int, field graphql.CollectedField) { + out.Values[i] = ec._CommentTimelineItem_lastEdit(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + wg.Done() + }(i, field) + case "edited": + out.Values[i] = ec._CommentTimelineItem_edited(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "history": + out.Values[i] = ec._CommentTimelineItem_history(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) _CommentTimelineItem_hash(ctx context.Context, field graphql.CollectedField, obj *bug.CommentTimelineItem) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "CommentTimelineItem", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Hash() + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(git.Hash) + rctx.Result = res + return res +} + +// nolint: vetshadow +func (ec *executionContext) _CommentTimelineItem_author(ctx context.Context, field graphql.CollectedField, obj *bug.CommentTimelineItem) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "CommentTimelineItem", + 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) _CommentTimelineItem_message(ctx context.Context, field graphql.CollectedField, obj *bug.CommentTimelineItem) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "CommentTimelineItem", + 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) _CommentTimelineItem_files(ctx context.Context, field graphql.CollectedField, obj *bug.CommentTimelineItem) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "CommentTimelineItem", + 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[idx1] = func() graphql.Marshaler { + return res[idx1] + }() + } + + return arr1 +} + +// nolint: vetshadow +func (ec *executionContext) _CommentTimelineItem_createdAt(ctx context.Context, field graphql.CollectedField, obj *bug.CommentTimelineItem) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "CommentTimelineItem", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.CommentTimelineItem().CreatedAt(ctx, obj) + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + rctx.Result = res + return graphql.MarshalTime(res) +} + +// nolint: vetshadow +func (ec *executionContext) _CommentTimelineItem_lastEdit(ctx context.Context, field graphql.CollectedField, obj *bug.CommentTimelineItem) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "CommentTimelineItem", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.CommentTimelineItem().LastEdit(ctx, obj) + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + rctx.Result = res + return graphql.MarshalTime(res) +} + +// nolint: vetshadow +func (ec *executionContext) _CommentTimelineItem_edited(ctx context.Context, field graphql.CollectedField, obj *bug.CommentTimelineItem) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "CommentTimelineItem", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Edited(), 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) _CommentTimelineItem_history(ctx context.Context, field graphql.CollectedField, obj *bug.CommentTimelineItem) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "CommentTimelineItem", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.History, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]bug.CommentHistoryStep) + 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 { + 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._CommentHistoryStep(ctx, field.Selections, &res[idx1]) + }() + } + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 +} + var createOperationImplementors = []string{"CreateOperation", "Operation", "Authored"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _CreateOperation(ctx context.Context, sel ast.SelectionSet, obj *operations.CreateOperation) graphql.Marshaler { +func (ec *executionContext) _CreateOperation(ctx context.Context, sel ast.SelectionSet, obj *bug.CreateOperation) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, createOperationImplementors) var wg sync.WaitGroup @@ -2631,7 +3366,7 @@ func (ec *executionContext) _CreateOperation(ctx context.Context, sel ast.Select } // nolint: vetshadow -func (ec *executionContext) _CreateOperation_author(ctx context.Context, field graphql.CollectedField, obj *operations.CreateOperation) graphql.Marshaler { +func (ec *executionContext) _CreateOperation_author(ctx context.Context, field graphql.CollectedField, obj *bug.CreateOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "CreateOperation", Args: nil, @@ -2654,7 +3389,7 @@ func (ec *executionContext) _CreateOperation_author(ctx context.Context, field g } // nolint: vetshadow -func (ec *executionContext) _CreateOperation_date(ctx context.Context, field graphql.CollectedField, obj *operations.CreateOperation) graphql.Marshaler { +func (ec *executionContext) _CreateOperation_date(ctx context.Context, field graphql.CollectedField, obj *bug.CreateOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "CreateOperation", Args: nil, @@ -2676,7 +3411,7 @@ func (ec *executionContext) _CreateOperation_date(ctx context.Context, field gra } // nolint: vetshadow -func (ec *executionContext) _CreateOperation_title(ctx context.Context, field graphql.CollectedField, obj *operations.CreateOperation) graphql.Marshaler { +func (ec *executionContext) _CreateOperation_title(ctx context.Context, field graphql.CollectedField, obj *bug.CreateOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "CreateOperation", Args: nil, @@ -2698,7 +3433,7 @@ func (ec *executionContext) _CreateOperation_title(ctx context.Context, field gr } // nolint: vetshadow -func (ec *executionContext) _CreateOperation_message(ctx context.Context, field graphql.CollectedField, obj *operations.CreateOperation) graphql.Marshaler { +func (ec *executionContext) _CreateOperation_message(ctx context.Context, field graphql.CollectedField, obj *bug.CreateOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "CreateOperation", Args: nil, @@ -2720,7 +3455,7 @@ func (ec *executionContext) _CreateOperation_message(ctx context.Context, field } // nolint: vetshadow -func (ec *executionContext) _CreateOperation_files(ctx context.Context, field graphql.CollectedField, obj *operations.CreateOperation) graphql.Marshaler { +func (ec *executionContext) _CreateOperation_files(ctx context.Context, field graphql.CollectedField, obj *bug.CreateOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "CreateOperation", Args: nil, @@ -2750,10 +3485,303 @@ func (ec *executionContext) _CreateOperation_files(ctx context.Context, field gr return arr1 } -var labelChangeOperationImplementors = []string{"LabelChangeOperation", "Operation", "Authored"} +var createTimelineItemImplementors = []string{"CreateTimelineItem", "TimelineItem"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _LabelChangeOperation(ctx context.Context, sel ast.SelectionSet, obj *operations.LabelChangeOperation) graphql.Marshaler { +func (ec *executionContext) _CreateTimelineItem(ctx context.Context, sel ast.SelectionSet, obj *bug.CreateTimelineItem) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, createTimelineItemImplementors) + + var wg sync.WaitGroup + out := graphql.NewOrderedMap(len(fields)) + invalid := false + for i, field := range fields { + out.Keys[i] = field.Alias + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("CreateTimelineItem") + case "hash": + out.Values[i] = ec._CreateTimelineItem_hash(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "author": + out.Values[i] = ec._CreateTimelineItem_author(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "message": + out.Values[i] = ec._CreateTimelineItem_message(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "files": + out.Values[i] = ec._CreateTimelineItem_files(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "createdAt": + wg.Add(1) + go func(i int, field graphql.CollectedField) { + out.Values[i] = ec._CreateTimelineItem_createdAt(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + wg.Done() + }(i, field) + case "lastEdit": + wg.Add(1) + go func(i int, field graphql.CollectedField) { + out.Values[i] = ec._CreateTimelineItem_lastEdit(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + wg.Done() + }(i, field) + case "edited": + out.Values[i] = ec._CreateTimelineItem_edited(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "history": + out.Values[i] = ec._CreateTimelineItem_history(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) _CreateTimelineItem_hash(ctx context.Context, field graphql.CollectedField, obj *bug.CreateTimelineItem) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "CreateTimelineItem", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Hash() + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(git.Hash) + rctx.Result = res + return res +} + +// nolint: vetshadow +func (ec *executionContext) _CreateTimelineItem_author(ctx context.Context, field graphql.CollectedField, obj *bug.CreateTimelineItem) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "CreateTimelineItem", + 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) _CreateTimelineItem_message(ctx context.Context, field graphql.CollectedField, obj *bug.CreateTimelineItem) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "CreateTimelineItem", + 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) _CreateTimelineItem_files(ctx context.Context, field graphql.CollectedField, obj *bug.CreateTimelineItem) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "CreateTimelineItem", + 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[idx1] = func() graphql.Marshaler { + return res[idx1] + }() + } + + return arr1 +} + +// nolint: vetshadow +func (ec *executionContext) _CreateTimelineItem_createdAt(ctx context.Context, field graphql.CollectedField, obj *bug.CreateTimelineItem) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "CreateTimelineItem", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.CreateTimelineItem().CreatedAt(ctx, obj) + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + rctx.Result = res + return graphql.MarshalTime(res) +} + +// nolint: vetshadow +func (ec *executionContext) _CreateTimelineItem_lastEdit(ctx context.Context, field graphql.CollectedField, obj *bug.CreateTimelineItem) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "CreateTimelineItem", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.CreateTimelineItem().LastEdit(ctx, obj) + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + rctx.Result = res + return graphql.MarshalTime(res) +} + +// nolint: vetshadow +func (ec *executionContext) _CreateTimelineItem_edited(ctx context.Context, field graphql.CollectedField, obj *bug.CreateTimelineItem) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "CreateTimelineItem", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Edited(), 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) _CreateTimelineItem_history(ctx context.Context, field graphql.CollectedField, obj *bug.CreateTimelineItem) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "CreateTimelineItem", + Args: nil, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.History, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]bug.CommentHistoryStep) + 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 { + 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._CommentHistoryStep(ctx, field.Selections, &res[idx1]) + }() + } + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 +} + +var labelChangeOperationImplementors = []string{"LabelChangeOperation", "Operation", "Authored", "TimelineItem"} + +// nolint: gocyclo, errcheck, gas, goconst +func (ec *executionContext) _LabelChangeOperation(ctx context.Context, sel ast.SelectionSet, obj *bug.LabelChangeOperation) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, labelChangeOperationImplementors) var wg sync.WaitGroup @@ -2765,6 +3793,11 @@ func (ec *executionContext) _LabelChangeOperation(ctx context.Context, sel ast.S switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("LabelChangeOperation") + case "hash": + out.Values[i] = ec._LabelChangeOperation_hash(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "author": wg.Add(1) go func(i int, field graphql.CollectedField) { @@ -2805,7 +3838,29 @@ func (ec *executionContext) _LabelChangeOperation(ctx context.Context, sel ast.S } // nolint: vetshadow -func (ec *executionContext) _LabelChangeOperation_author(ctx context.Context, field graphql.CollectedField, obj *operations.LabelChangeOperation) graphql.Marshaler { +func (ec *executionContext) _LabelChangeOperation_hash(ctx context.Context, field graphql.CollectedField, obj *bug.LabelChangeOperation) graphql.Marshaler { + 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.Hash() + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(git.Hash) + rctx.Result = res + return res +} + +// nolint: vetshadow +func (ec *executionContext) _LabelChangeOperation_author(ctx context.Context, field graphql.CollectedField, obj *bug.LabelChangeOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "LabelChangeOperation", Args: nil, @@ -2828,7 +3883,7 @@ func (ec *executionContext) _LabelChangeOperation_author(ctx context.Context, fi } // nolint: vetshadow -func (ec *executionContext) _LabelChangeOperation_date(ctx context.Context, field graphql.CollectedField, obj *operations.LabelChangeOperation) graphql.Marshaler { +func (ec *executionContext) _LabelChangeOperation_date(ctx context.Context, field graphql.CollectedField, obj *bug.LabelChangeOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "LabelChangeOperation", Args: nil, @@ -2850,7 +3905,7 @@ func (ec *executionContext) _LabelChangeOperation_date(ctx context.Context, fiel } // nolint: vetshadow -func (ec *executionContext) _LabelChangeOperation_added(ctx context.Context, field graphql.CollectedField, obj *operations.LabelChangeOperation) graphql.Marshaler { +func (ec *executionContext) _LabelChangeOperation_added(ctx context.Context, field graphql.CollectedField, obj *bug.LabelChangeOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "LabelChangeOperation", Args: nil, @@ -2881,7 +3936,7 @@ func (ec *executionContext) _LabelChangeOperation_added(ctx context.Context, fie } // nolint: vetshadow -func (ec *executionContext) _LabelChangeOperation_removed(ctx context.Context, field graphql.CollectedField, obj *operations.LabelChangeOperation) graphql.Marshaler { +func (ec *executionContext) _LabelChangeOperation_removed(ctx context.Context, field graphql.CollectedField, obj *bug.LabelChangeOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "LabelChangeOperation", Args: nil, @@ -3939,10 +4994,10 @@ func (ec *executionContext) _Repository_bug(ctx context.Context, field graphql.C return ec._Bug(ctx, field.Selections, res) } -var setStatusOperationImplementors = []string{"SetStatusOperation", "Operation", "Authored"} +var setStatusOperationImplementors = []string{"SetStatusOperation", "Operation", "Authored", "TimelineItem"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _SetStatusOperation(ctx context.Context, sel ast.SelectionSet, obj *operations.SetStatusOperation) graphql.Marshaler { +func (ec *executionContext) _SetStatusOperation(ctx context.Context, sel ast.SelectionSet, obj *bug.SetStatusOperation) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, setStatusOperationImplementors) var wg sync.WaitGroup @@ -3954,6 +5009,11 @@ func (ec *executionContext) _SetStatusOperation(ctx context.Context, sel ast.Sel switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("SetStatusOperation") + case "hash": + out.Values[i] = ec._SetStatusOperation_hash(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "author": wg.Add(1) go func(i int, field graphql.CollectedField) { @@ -3993,7 +5053,29 @@ func (ec *executionContext) _SetStatusOperation(ctx context.Context, sel ast.Sel } // nolint: vetshadow -func (ec *executionContext) _SetStatusOperation_author(ctx context.Context, field graphql.CollectedField, obj *operations.SetStatusOperation) graphql.Marshaler { +func (ec *executionContext) _SetStatusOperation_hash(ctx context.Context, field graphql.CollectedField, obj *bug.SetStatusOperation) graphql.Marshaler { + 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.Hash() + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(git.Hash) + rctx.Result = res + return res +} + +// nolint: vetshadow +func (ec *executionContext) _SetStatusOperation_author(ctx context.Context, field graphql.CollectedField, obj *bug.SetStatusOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "SetStatusOperation", Args: nil, @@ -4016,7 +5098,7 @@ func (ec *executionContext) _SetStatusOperation_author(ctx context.Context, fiel } // nolint: vetshadow -func (ec *executionContext) _SetStatusOperation_date(ctx context.Context, field graphql.CollectedField, obj *operations.SetStatusOperation) graphql.Marshaler { +func (ec *executionContext) _SetStatusOperation_date(ctx context.Context, field graphql.CollectedField, obj *bug.SetStatusOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "SetStatusOperation", Args: nil, @@ -4038,7 +5120,7 @@ func (ec *executionContext) _SetStatusOperation_date(ctx context.Context, field } // nolint: vetshadow -func (ec *executionContext) _SetStatusOperation_status(ctx context.Context, field graphql.CollectedField, obj *operations.SetStatusOperation) graphql.Marshaler { +func (ec *executionContext) _SetStatusOperation_status(ctx context.Context, field graphql.CollectedField, obj *bug.SetStatusOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "SetStatusOperation", Args: nil, @@ -4059,10 +5141,10 @@ func (ec *executionContext) _SetStatusOperation_status(ctx context.Context, fiel return res } -var setTitleOperationImplementors = []string{"SetTitleOperation", "Operation", "Authored"} +var setTitleOperationImplementors = []string{"SetTitleOperation", "Operation", "Authored", "TimelineItem"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _SetTitleOperation(ctx context.Context, sel ast.SelectionSet, obj *operations.SetTitleOperation) graphql.Marshaler { +func (ec *executionContext) _SetTitleOperation(ctx context.Context, sel ast.SelectionSet, obj *bug.SetTitleOperation) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, setTitleOperationImplementors) var wg sync.WaitGroup @@ -4074,6 +5156,11 @@ func (ec *executionContext) _SetTitleOperation(ctx context.Context, sel ast.Sele switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("SetTitleOperation") + case "hash": + out.Values[i] = ec._SetTitleOperation_hash(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } case "author": wg.Add(1) go func(i int, field graphql.CollectedField) { @@ -4114,7 +5201,29 @@ func (ec *executionContext) _SetTitleOperation(ctx context.Context, sel ast.Sele } // nolint: vetshadow -func (ec *executionContext) _SetTitleOperation_author(ctx context.Context, field graphql.CollectedField, obj *operations.SetTitleOperation) graphql.Marshaler { +func (ec *executionContext) _SetTitleOperation_hash(ctx context.Context, field graphql.CollectedField, obj *bug.SetTitleOperation) graphql.Marshaler { + 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.Hash() + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(git.Hash) + rctx.Result = res + return res +} + +// nolint: vetshadow +func (ec *executionContext) _SetTitleOperation_author(ctx context.Context, field graphql.CollectedField, obj *bug.SetTitleOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "SetTitleOperation", Args: nil, @@ -4137,7 +5246,7 @@ func (ec *executionContext) _SetTitleOperation_author(ctx context.Context, field } // nolint: vetshadow -func (ec *executionContext) _SetTitleOperation_date(ctx context.Context, field graphql.CollectedField, obj *operations.SetTitleOperation) graphql.Marshaler { +func (ec *executionContext) _SetTitleOperation_date(ctx context.Context, field graphql.CollectedField, obj *bug.SetTitleOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "SetTitleOperation", Args: nil, @@ -4159,7 +5268,7 @@ func (ec *executionContext) _SetTitleOperation_date(ctx context.Context, field g } // nolint: vetshadow -func (ec *executionContext) _SetTitleOperation_title(ctx context.Context, field graphql.CollectedField, obj *operations.SetTitleOperation) graphql.Marshaler { +func (ec *executionContext) _SetTitleOperation_title(ctx context.Context, field graphql.CollectedField, obj *bug.SetTitleOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "SetTitleOperation", Args: nil, @@ -4181,7 +5290,7 @@ func (ec *executionContext) _SetTitleOperation_title(ctx context.Context, field } // nolint: vetshadow -func (ec *executionContext) _SetTitleOperation_was(ctx context.Context, field graphql.CollectedField, obj *operations.SetTitleOperation) graphql.Marshaler { +func (ec *executionContext) _SetTitleOperation_was(ctx context.Context, field graphql.CollectedField, obj *bug.SetTitleOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "SetTitleOperation", Args: nil, @@ -4202,6 +5311,286 @@ func (ec *executionContext) _SetTitleOperation_was(ctx context.Context, field gr return graphql.MarshalString(res) } +var timelineItemConnectionImplementors = []string{"TimelineItemConnection"} + +// nolint: gocyclo, errcheck, gas, goconst +func (ec *executionContext) _TimelineItemConnection(ctx context.Context, sel ast.SelectionSet, obj *models.TimelineItemConnection) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, timelineItemConnectionImplementors) + + out := graphql.NewOrderedMap(len(fields)) + invalid := false + for i, field := range fields { + out.Keys[i] = field.Alias + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("TimelineItemConnection") + case "edges": + out.Values[i] = ec._TimelineItemConnection_edges(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "nodes": + out.Values[i] = ec._TimelineItemConnection_nodes(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "pageInfo": + out.Values[i] = ec._TimelineItemConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "totalCount": + out.Values[i] = ec._TimelineItemConnection_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) _TimelineItemConnection_edges(ctx context.Context, field graphql.CollectedField, obj *models.TimelineItemConnection) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "TimelineItemConnection", + 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.TimelineItemEdge) + 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 { + 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._TimelineItemEdge(ctx, field.Selections, &res[idx1]) + }() + } + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 +} + +// nolint: vetshadow +func (ec *executionContext) _TimelineItemConnection_nodes(ctx context.Context, field graphql.CollectedField, obj *models.TimelineItemConnection) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "TimelineItemConnection", + 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.TimelineItem) + 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 { + 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._TimelineItem(ctx, field.Selections, &res[idx1]) + }() + } + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 +} + +// nolint: vetshadow +func (ec *executionContext) _TimelineItemConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *models.TimelineItemConnection) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "TimelineItemConnection", + 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) _TimelineItemConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *models.TimelineItemConnection) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "TimelineItemConnection", + 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 timelineItemEdgeImplementors = []string{"TimelineItemEdge"} + +// nolint: gocyclo, errcheck, gas, goconst +func (ec *executionContext) _TimelineItemEdge(ctx context.Context, sel ast.SelectionSet, obj *models.TimelineItemEdge) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, timelineItemEdgeImplementors) + + out := graphql.NewOrderedMap(len(fields)) + invalid := false + for i, field := range fields { + out.Keys[i] = field.Alias + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("TimelineItemEdge") + case "cursor": + out.Values[i] = ec._TimelineItemEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "node": + out.Values[i] = ec._TimelineItemEdge_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) _TimelineItemEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *models.TimelineItemEdge) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "TimelineItemEdge", + 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) _TimelineItemEdge_node(ctx context.Context, field graphql.CollectedField, obj *models.TimelineItemEdge) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "TimelineItemEdge", + 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.TimelineItem) + rctx.Result = res + + return ec._TimelineItem(ctx, field.Selections, &res) +} + var __DirectiveImplementors = []string{"__Directive"} // nolint: gocyclo, errcheck, gas, goconst @@ -5487,25 +6876,25 @@ func (ec *executionContext) _Authored(ctx context.Context, sel ast.SelectionSet, return ec._Comment(ctx, sel, &obj) case *bug.Comment: return ec._Comment(ctx, sel, obj) - case operations.CreateOperation: + case bug.CreateOperation: return ec._CreateOperation(ctx, sel, &obj) - case *operations.CreateOperation: + case *bug.CreateOperation: return ec._CreateOperation(ctx, sel, obj) - case operations.SetTitleOperation: + case bug.SetTitleOperation: return ec._SetTitleOperation(ctx, sel, &obj) - case *operations.SetTitleOperation: + case *bug.SetTitleOperation: return ec._SetTitleOperation(ctx, sel, obj) - case operations.AddCommentOperation: + case bug.AddCommentOperation: return ec._AddCommentOperation(ctx, sel, &obj) - case *operations.AddCommentOperation: + case *bug.AddCommentOperation: return ec._AddCommentOperation(ctx, sel, obj) - case operations.SetStatusOperation: + case bug.SetStatusOperation: return ec._SetStatusOperation(ctx, sel, &obj) - case *operations.SetStatusOperation: + case *bug.SetStatusOperation: return ec._SetStatusOperation(ctx, sel, obj) - case operations.LabelChangeOperation: + case bug.LabelChangeOperation: return ec._LabelChangeOperation(ctx, sel, &obj) - case *operations.LabelChangeOperation: + case *bug.LabelChangeOperation: return ec._LabelChangeOperation(ctx, sel, obj) default: panic(fmt.Errorf("unexpected type %T", obj)) @@ -5516,16 +6905,35 @@ func (ec *executionContext) _Operation(ctx context.Context, sel ast.SelectionSet switch obj := (*obj).(type) { case nil: return graphql.Null - case operations.CreateOperation: - return ec._CreateOperation(ctx, sel, &obj) - case operations.SetTitleOperation: - return ec._SetTitleOperation(ctx, sel, &obj) - case operations.AddCommentOperation: - return ec._AddCommentOperation(ctx, sel, &obj) - case operations.SetStatusOperation: - return ec._SetStatusOperation(ctx, sel, &obj) - case operations.LabelChangeOperation: - return ec._LabelChangeOperation(ctx, sel, &obj) + case *bug.CreateOperation: + return ec._CreateOperation(ctx, sel, obj) + case *bug.SetTitleOperation: + return ec._SetTitleOperation(ctx, sel, obj) + case *bug.AddCommentOperation: + return ec._AddCommentOperation(ctx, sel, obj) + case *bug.SetStatusOperation: + return ec._SetStatusOperation(ctx, sel, obj) + case *bug.LabelChangeOperation: + return ec._LabelChangeOperation(ctx, sel, obj) + default: + panic(fmt.Errorf("unexpected type %T", obj)) + } +} + +func (ec *executionContext) _TimelineItem(ctx context.Context, sel ast.SelectionSet, obj *bug.TimelineItem) graphql.Marshaler { + switch obj := (*obj).(type) { + case nil: + return graphql.Null + case *bug.SetTitleOperation: + return ec._SetTitleOperation(ctx, sel, obj) + case *bug.SetStatusOperation: + return ec._SetStatusOperation(ctx, sel, obj) + case *bug.LabelChangeOperation: + return ec._LabelChangeOperation(ctx, sel, obj) + case *bug.CreateTimelineItem: + return ec._CreateTimelineItem(ctx, sel, obj) + case *bug.CommentTimelineItem: + return ec._CommentTimelineItem(ctx, sel, obj) default: panic(fmt.Errorf("unexpected type %T", obj)) } @@ -5630,6 +7038,11 @@ type OperationEdge { node: Operation! } +"""An item in the timeline of events""" +interface TimelineItem { + hash: Hash! +} + """An operation applied to a bug.""" interface Operation { """The operations author.""" @@ -5647,7 +7060,8 @@ type CreateOperation implements Operation & Authored { files: [Hash!]! } -type SetTitleOperation implements Operation & Authored { +type SetTitleOperation implements Operation & Authored & TimelineItem { + hash: Hash! author: Person! date: Time! @@ -5663,14 +7077,16 @@ type AddCommentOperation implements Operation & Authored { files: [Hash!]! } -type SetStatusOperation implements Operation & Authored { +type SetStatusOperation implements Operation & Authored & TimelineItem { + hash: Hash! author: Person! date: Time! status: Status! } -type LabelChangeOperation implements Operation & Authored { +type LabelChangeOperation implements Operation & Authored & TimelineItem { + hash: Hash! author: Person! date: Time! @@ -5678,6 +7094,45 @@ type LabelChangeOperation implements Operation & Authored { removed: [Label!]! } +type TimelineItemConnection { + edges: [TimelineItemEdge!]! + nodes: [TimelineItem!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type TimelineItemEdge { + cursor: String! + node: TimelineItem! +} + +type CommentHistoryStep { + message: String! + date: Time! +} + +type CreateTimelineItem implements TimelineItem { + hash: Hash! + author: Person! + message: String! + files: [Hash!]! + createdAt: Time! + lastEdit: Time! + edited: Boolean! + history: [CommentHistoryStep!]! +} + +type CommentTimelineItem implements TimelineItem { + hash: Hash! + author: Person! + message: String! + files: [Hash!]! + createdAt: Time! + lastEdit: Time! + edited: Boolean! + history: [CommentHistoryStep!]! +} + """The connection type for Bug.""" type BugConnection { """A list of edges.""" @@ -5718,6 +7173,17 @@ type Bug { last: Int ): CommentConnection! + timeline( + """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.""" + before: String + """Returns the first _n_ elements from the list.""" + first: Int + """Returns the last _n_ elements from the list.""" + last: Int + ): TimelineItemConnection! + operations( """Returns the elements in the list that come after the specified cursor.""" after: String |