From 36ebbe0cf4078070c3a6710f2e1f781c03de3d1a Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sat, 29 Sep 2018 20:58:25 +0200 Subject: graphql: expose the new Timeline --- graphql/graph/gen_graph.go | 2057 ++++++++++++++++++++++++++++++++------------ 1 file changed, 1503 insertions(+), 554 deletions(-) (limited to 'graphql/graph') diff --git a/graphql/graph/gen_graph.go b/graphql/graph/gen_graph.go index 1425032a..032cf5cb 100644 --- a/graphql/graph/gen_graph.go +++ b/graphql/graph/gen_graph.go @@ -67,6 +67,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 } @@ -100,6 +101,12 @@ type ComplexityRoot struct { Node func(childComplexity int) int } + CommentTimelineItem struct { + Hash func(childComplexity int) int + LastState func(childComplexity int) int + History func(childComplexity int) int + } + CreateOperation struct { Author func(childComplexity int) int Date func(childComplexity int) int @@ -108,7 +115,14 @@ type ComplexityRoot struct { Files func(childComplexity int) int } + CreateTimelineItem struct { + Hash func(childComplexity int) int + LastState 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 @@ -161,17 +175,31 @@ 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 { @@ -183,6 +211,7 @@ type BugResolver interface { 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 CreateOperationResolver interface { @@ -282,6 +311,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 @@ -914,6 +1005,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 @@ -1031,6 +1134,27 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.CommentEdge.Node(childComplexity), true + case "CommentTimelineItem.hash": + if e.complexity.CommentTimelineItem.Hash == nil { + break + } + + return e.complexity.CommentTimelineItem.Hash(childComplexity), true + + case "CommentTimelineItem.lastState": + if e.complexity.CommentTimelineItem.LastState == nil { + break + } + + return e.complexity.CommentTimelineItem.LastState(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 @@ -1066,6 +1190,34 @@ 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.lastState": + if e.complexity.CreateTimelineItem.LastState == nil { + break + } + + return e.complexity.CreateTimelineItem.LastState(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 @@ -1312,6 +1464,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 @@ -1333,6 +1492,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 @@ -1361,6 +1527,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 } @@ -1630,6 +1838,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) { @@ -1865,6 +2082,35 @@ func (ec *executionContext) _Bug_comments(ctx context.Context, field graphql.Col return ec._CommentConnection(ctx, field.Selections, &res) } +// 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) @@ -2570,13 +2816,12 @@ func (ec *executionContext) _CommentEdge_node(ctx context.Context, field graphql return ec._Comment(ctx, field.Selections, &res) } -var createOperationImplementors = []string{"CreateOperation", "Operation", "Authored"} +var commentTimelineItemImplementors = []string{"CommentTimelineItem", "TimelineItem"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _CreateOperation(ctx context.Context, sel ast.SelectionSet, obj *bug.CreateOperation) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, createOperationImplementors) +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 { @@ -2584,37 +2829,19 @@ func (ec *executionContext) _CreateOperation(ctx context.Context, sel ast.Select switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("CreateOperation") - case "author": - wg.Add(1) - go func(i int, field graphql.CollectedField) { - out.Values[i] = ec._CreateOperation_author(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalid = true - } - wg.Done() - }(i, field) - case "date": - 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) + 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 "message": - out.Values[i] = ec._CreateOperation_message(ctx, field, obj) + case "lastState": + out.Values[i] = ec._CommentTimelineItem_lastState(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } - case "files": - out.Values[i] = ec._CreateOperation_files(ctx, field, obj) + case "history": + out.Values[i] = ec._CommentTimelineItem_history(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } @@ -2622,7 +2849,7 @@ func (ec *executionContext) _CreateOperation(ctx context.Context, sel ast.Select panic("unknown field " + strconv.Quote(field.Name)) } } - wg.Wait() + if invalid { return graphql.Null } @@ -2630,15 +2857,15 @@ func (ec *executionContext) _CreateOperation(ctx context.Context, sel ast.Select } // nolint: vetshadow -func (ec *executionContext) _CreateOperation_author(ctx context.Context, field graphql.CollectedField, obj *bug.CreateOperation) graphql.Marshaler { +func (ec *executionContext) _CommentTimelineItem_hash(ctx context.Context, field graphql.CollectedField, obj *bug.CommentTimelineItem) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "CreateOperation", + 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.CreateOperation().Author(ctx, obj) + return obj.Hash() }) if resTmp == nil { if !ec.HasError(rctx) { @@ -2646,22 +2873,21 @@ func (ec *executionContext) _CreateOperation_author(ctx context.Context, field g } return graphql.Null } - res := resTmp.(bug.Person) + res := resTmp.(git.Hash) rctx.Result = res - - return ec._Person(ctx, field.Selections, &res) + return res } // nolint: vetshadow -func (ec *executionContext) _CreateOperation_date(ctx context.Context, field graphql.CollectedField, obj *bug.CreateOperation) graphql.Marshaler { +func (ec *executionContext) _CommentTimelineItem_lastState(ctx context.Context, field graphql.CollectedField, obj *bug.CommentTimelineItem) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "CreateOperation", + 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.CreateOperation().Date(ctx, obj) + return obj.LastState(), nil }) if resTmp == nil { if !ec.HasError(rctx) { @@ -2669,21 +2895,22 @@ func (ec *executionContext) _CreateOperation_date(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(time.Time) + res := resTmp.(bug.Comment) rctx.Result = res - return graphql.MarshalTime(res) + + return ec._Comment(ctx, field.Selections, &res) } // nolint: vetshadow -func (ec *executionContext) _CreateOperation_title(ctx context.Context, field graphql.CollectedField, obj *bug.CreateOperation) graphql.Marshaler { +func (ec *executionContext) _CommentTimelineItem_history(ctx context.Context, field graphql.CollectedField, obj *bug.CommentTimelineItem) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "CreateOperation", + Object: "CommentTimelineItem", Args: nil, Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { - return obj.Title, nil + return obj.History, nil }) if resTmp == nil { if !ec.HasError(rctx) { @@ -2691,69 +2918,49 @@ func (ec *executionContext) _CreateOperation_title(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]bug.Comment) rctx.Result = res - return graphql.MarshalString(res) -} -// nolint: vetshadow -func (ec *executionContext) _CreateOperation_message(ctx context.Context, field graphql.CollectedField, obj *bug.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.Message, nil - }) - if resTmp == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup + + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) } - res := resTmp.(string) - rctx.Result = res - return graphql.MarshalString(res) -} -// nolint: vetshadow -func (ec *executionContext) _CreateOperation_files(ctx context.Context, field graphql.CollectedField, obj *bug.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.Files, nil - }) - if resTmp == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], } - return graphql.Null - } - res := resTmp.([]git.Hash) - rctx.Result = res + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() + } + arr1[idx1] = func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) + return ec._Comment(ctx, field.Selections, &res[idx1]) + }() + } + if isLen1 { + f(idx1) + } else { + go f(idx1) + } - for idx1 := range res { - arr1[idx1] = func() graphql.Marshaler { - return res[idx1] - }() } - + wg.Wait() return arr1 } -var labelChangeOperationImplementors = []string{"LabelChangeOperation", "Operation", "Authored"} +var createOperationImplementors = []string{"CreateOperation", "Operation", "Authored"} // 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) +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 out := graphql.NewOrderedMap(len(fields)) @@ -2763,11 +2970,11 @@ func (ec *executionContext) _LabelChangeOperation(ctx context.Context, sel ast.S switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("LabelChangeOperation") + out.Values[i] = graphql.MarshalString("CreateOperation") case "author": wg.Add(1) go func(i int, field graphql.CollectedField) { - out.Values[i] = ec._LabelChangeOperation_author(ctx, field, obj) + out.Values[i] = ec._CreateOperation_author(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } @@ -2776,19 +2983,24 @@ func (ec *executionContext) _LabelChangeOperation(ctx context.Context, sel ast.S case "date": wg.Add(1) go func(i int, field graphql.CollectedField) { - out.Values[i] = ec._LabelChangeOperation_date(ctx, field, obj) + out.Values[i] = ec._CreateOperation_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) + case "title": + out.Values[i] = ec._CreateOperation_title(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } - case "removed": - out.Values[i] = ec._LabelChangeOperation_removed(ctx, field, obj) + 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 } @@ -2804,15 +3016,15 @@ func (ec *executionContext) _LabelChangeOperation(ctx context.Context, sel ast.S } // nolint: vetshadow -func (ec *executionContext) _LabelChangeOperation_author(ctx context.Context, field graphql.CollectedField, obj *bug.LabelChangeOperation) graphql.Marshaler { +func (ec *executionContext) _CreateOperation_author(ctx context.Context, field graphql.CollectedField, obj *bug.CreateOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "LabelChangeOperation", + 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.LabelChangeOperation().Author(ctx, obj) + return ec.resolvers.CreateOperation().Author(ctx, obj) }) if resTmp == nil { if !ec.HasError(rctx) { @@ -2827,15 +3039,15 @@ func (ec *executionContext) _LabelChangeOperation_author(ctx context.Context, fi } // nolint: vetshadow -func (ec *executionContext) _LabelChangeOperation_date(ctx context.Context, field graphql.CollectedField, obj *bug.LabelChangeOperation) graphql.Marshaler { +func (ec *executionContext) _CreateOperation_date(ctx context.Context, field graphql.CollectedField, obj *bug.CreateOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "LabelChangeOperation", + 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.LabelChangeOperation().Date(ctx, obj) + return ec.resolvers.CreateOperation().Date(ctx, obj) }) if resTmp == nil { if !ec.HasError(rctx) { @@ -2849,15 +3061,15 @@ func (ec *executionContext) _LabelChangeOperation_date(ctx context.Context, fiel } // nolint: vetshadow -func (ec *executionContext) _LabelChangeOperation_added(ctx context.Context, field graphql.CollectedField, obj *bug.LabelChangeOperation) graphql.Marshaler { +func (ec *executionContext) _CreateOperation_title(ctx context.Context, field graphql.CollectedField, obj *bug.CreateOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "LabelChangeOperation", + Object: "CreateOperation", Args: nil, Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { - return obj.Added, nil + return obj.Title, nil }) if resTmp == nil { if !ec.HasError(rctx) { @@ -2865,30 +3077,43 @@ func (ec *executionContext) _LabelChangeOperation_added(ctx context.Context, fie } return graphql.Null } - res := resTmp.([]bug.Label) + res := resTmp.(string) rctx.Result = res + return graphql.MarshalString(res) +} - arr1 := make(graphql.Array, len(res)) - - for idx1 := range res { - arr1[idx1] = func() graphql.Marshaler { - return res[idx1] - }() +// nolint: vetshadow +func (ec *executionContext) _CreateOperation_message(ctx context.Context, field graphql.CollectedField, obj *bug.CreateOperation) graphql.Marshaler { + rctx := &graphql.ResolverContext{ + Object: "CreateOperation", + Args: nil, + Field: field, } - - return arr1 + 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) _LabelChangeOperation_removed(ctx context.Context, field graphql.CollectedField, obj *bug.LabelChangeOperation) graphql.Marshaler { +func (ec *executionContext) _CreateOperation_files(ctx context.Context, field graphql.CollectedField, obj *bug.CreateOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "LabelChangeOperation", + Object: "CreateOperation", Args: nil, Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { - return obj.Removed, nil + return obj.Files, nil }) if resTmp == nil { if !ec.HasError(rctx) { @@ -2896,7 +3121,7 @@ func (ec *executionContext) _LabelChangeOperation_removed(ctx context.Context, f } return graphql.Null } - res := resTmp.([]bug.Label) + res := resTmp.([]git.Hash) rctx.Result = res arr1 := make(graphql.Array, len(res)) @@ -2910,15 +3135,11 @@ func (ec *executionContext) _LabelChangeOperation_removed(ctx context.Context, f return arr1 } -var mutationImplementors = []string{"Mutation"} +var createTimelineItemImplementors = []string{"CreateTimelineItem", "TimelineItem"} // nolint: gocyclo, errcheck, gas, goconst -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", - }) +func (ec *executionContext) _CreateTimelineItem(ctx context.Context, sel ast.SelectionSet, obj *bug.CreateTimelineItem) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, createTimelineItemImplementors) out := graphql.NewOrderedMap(len(fields)) invalid := false @@ -2927,39 +3148,19 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) switch field.Name { case "__typename": - 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) - if out.Values[i] == graphql.Null { - invalid = true - } - case "close": - out.Values[i] = ec._Mutation_close(ctx, field) + 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 "setTitle": - out.Values[i] = ec._Mutation_setTitle(ctx, field) + case "lastState": + out.Values[i] = ec._CreateTimelineItem_lastState(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } - case "commit": - out.Values[i] = ec._Mutation_commit(ctx, field) + case "history": + out.Values[i] = ec._CreateTimelineItem_history(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } @@ -2975,21 +3176,15 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) } // 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 - } +func (ec *executionContext) _CreateTimelineItem_hash(ctx context.Context, field graphql.CollectedField, obj *bug.CreateTimelineItem) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Mutation", - Args: args, + Object: "CreateTimelineItem", + Args: nil, 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)) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.Hash() }) if resTmp == nil { if !ec.HasError(rctx) { @@ -2997,28 +3192,21 @@ func (ec *executionContext) _Mutation_newBug(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.(bug.Snapshot) + res := resTmp.(git.Hash) rctx.Result = res - - return ec._Bug(ctx, field.Selections, &res) + return res } // 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 - } +func (ec *executionContext) _CreateTimelineItem_lastState(ctx context.Context, field graphql.CollectedField, obj *bug.CreateTimelineItem) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Mutation", - Args: args, + Object: "CreateTimelineItem", + Args: nil, 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)) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.LastState(), nil }) if resTmp == nil { if !ec.HasError(rctx) { @@ -3026,28 +3214,22 @@ func (ec *executionContext) _Mutation_addComment(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(bug.Snapshot) + res := resTmp.(bug.Comment) rctx.Result = res - return ec._Bug(ctx, field.Selections, &res) + return ec._Comment(ctx, field.Selections, &res) } // 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 - } +func (ec *executionContext) _CreateTimelineItem_history(ctx context.Context, field graphql.CollectedField, obj *bug.CreateTimelineItem) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Mutation", - Args: args, + Object: "CreateTimelineItem", + Args: nil, Field: field, } 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)) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return obj.History, nil }) if resTmp == nil { if !ec.HasError(rctx) { @@ -3055,47 +3237,418 @@ func (ec *executionContext) _Mutation_changeLabels(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(bug.Snapshot) + res := resTmp.([]bug.Comment) rctx.Result = res - return ec._Bug(ctx, field.Selections, &res) -} + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup -// 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 + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) } - res := resTmp.(bug.Snapshot) - rctx.Result = res - return ec._Bug(ctx, field.Selections, &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 { -// 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 ec._Comment(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 + 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("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) { + out.Values[i] = ec._LabelChangeOperation_author(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + wg.Done() + }(i, field) + case "date": + 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_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, + Field: field, + } + ctx = graphql.WithResolverContext(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.LabelChangeOperation().Author(ctx, obj) + }) + 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 *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 ec.resolvers.LabelChangeOperation().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) +} + +// nolint: vetshadow +func (ec *executionContext) _LabelChangeOperation_added(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.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[idx1] = func() graphql.Marshaler { + return res[idx1] + }() + } + + return arr1 +} + +// nolint: vetshadow +func (ec *executionContext) _LabelChangeOperation_removed(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.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[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 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 + + switch field.Name { + case "__typename": + 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) + if out.Values[i] == graphql.Null { + invalid = true + } + case "close": + out.Values[i] = ec._Mutation_close(ctx, field) + if out.Values[i] == graphql.Null { + invalid = true + } + 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)) + } + } + + 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) +} + +// 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) +} + +// 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 + } + 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().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) +} + +// 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 } rctx := &graphql.ResolverContext{ @@ -3495,7 +4048,235 @@ func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, 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.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.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.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.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 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 + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Person") + case "email": + out.Values[i] = ec._Person_email(ctx, field, obj) + case "name": + out.Values[i] = ec._Person_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + case "avatarUrl": + out.Values[i] = ec._Person_avatarUrl(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + + 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.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.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 { + 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) _Person_avatarUrl(ctx context.Context, field graphql.CollectedField, obj *bug.Person) graphql.Marshaler { + 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.AvatarUrl, 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 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 + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Query") + case "defaultRepository": + wg.Add(1) + go func(i int, field graphql.CollectedField) { + out.Values[i] = ec._Query_defaultRepository(ctx, field) + wg.Done() + }(i, field) + case "repository": + 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 } @@ -3503,99 +4284,120 @@ func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, } // nolint: vetshadow -func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *models.PageInfo) graphql.Marshaler { +func (ec *executionContext) _Query_defaultRepository(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "PageInfo", + Object: "Query", Args: nil, Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) - resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { - return obj.HasNextPage, nil + resTmp := ec.FieldMiddleware(ctx, nil, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.Query().DefaultRepository(ctx) }) if resTmp == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(*models.Repository) rctx.Result = res - return graphql.MarshalBoolean(res) + + if res == nil { + return graphql.Null + } + + return ec._Repository(ctx, field.Selections, res) } // nolint: vetshadow -func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField, obj *models.PageInfo) graphql.Marshaler { +func (ec *executionContext) _Query_repository(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { + rawArgs := field.ArgumentMap(ec.Variables) + args, err := field_Query_repository_args(rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } rctx := &graphql.ResolverContext{ - Object: "PageInfo", - Args: nil, + Object: "Query", + Args: args, Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) - resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { - return obj.HasPreviousPage, nil + resTmp := ec.FieldMiddleware(ctx, nil, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.Query().Repository(ctx, args["id"].(string)) }) if resTmp == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(*models.Repository) rctx.Result = res - return graphql.MarshalBoolean(res) + + if res == nil { + return graphql.Null + } + + return ec._Repository(ctx, field.Selections, res) } // nolint: vetshadow -func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *models.PageInfo) graphql.Marshaler { +func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { + rawArgs := field.ArgumentMap(ec.Variables) + args, err := field_Query___type_args(rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } rctx := &graphql.ResolverContext{ - Object: "PageInfo", - Args: nil, + Object: "Query", + Args: args, Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) - resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { - return obj.StartCursor, nil + resTmp := ec.FieldMiddleware(ctx, nil, func(ctx context.Context) (interface{}, error) { + return ec.introspectType(args["name"].(string)), nil }) if resTmp == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*introspection.Type) rctx.Result = res - return graphql.MarshalString(res) + + if res == nil { + return graphql.Null + } + + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow -func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *models.PageInfo) graphql.Marshaler { +func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "PageInfo", + Object: "Query", Args: nil, Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) - resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { - return obj.EndCursor, nil + resTmp := ec.FieldMiddleware(ctx, nil, func(ctx context.Context) (interface{}, error) { + return ec.introspectSchema(), nil }) if resTmp == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*introspection.Schema) rctx.Result = res - return graphql.MarshalString(res) + + if res == nil { + return graphql.Null + } + + return ec.___Schema(ctx, field.Selections, res) } -var personImplementors = []string{"Person"} +var repositoryImplementors = []string{"Repository"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _Person(ctx context.Context, sel ast.SelectionSet, obj *bug.Person) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, personImplementors) +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 { @@ -3603,21 +4405,27 @@ func (ec *executionContext) _Person(ctx context.Context, sel ast.SelectionSet, o switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Person") - case "email": - out.Values[i] = ec._Person_email(ctx, field, obj) - case "name": - out.Values[i] = ec._Person_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalid = true - } - case "avatarUrl": - out.Values[i] = ec._Person_avatarUrl(ctx, field, obj) + out.Values[i] = graphql.MarshalString("Repository") + case "allBugs": + 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": + 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 } @@ -3625,34 +4433,21 @@ func (ec *executionContext) _Person(ctx context.Context, sel ast.SelectionSet, o } // nolint: vetshadow -func (ec *executionContext) _Person_email(ctx context.Context, field graphql.CollectedField, obj *bug.Person) graphql.Marshaler { - 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 { +func (ec *executionContext) _Repository_allBugs(ctx context.Context, field graphql.CollectedField, obj *models.Repository) graphql.Marshaler { + rawArgs := field.ArgumentMap(ec.Variables) + args, err := field_Repository_allBugs_args(rawArgs) + if err != nil { + ec.Error(ctx, err) 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.ResolverContext{ - Object: "Person", - Args: nil, + Object: "Repository", + Args: args, Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { - return obj.Name, nil + return ec.resolvers.Repository().AllBugs(ctx, obj, args["after"].(*string), args["before"].(*string), args["first"].(*int), args["last"].(*int), args["query"].(*string)) }) if resTmp == nil { if !ec.HasError(rctx) { @@ -3660,39 +4455,47 @@ func (ec *executionContext) _Person_name(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.(string) + res := resTmp.(models.BugConnection) rctx.Result = res - return graphql.MarshalString(res) + + return ec._BugConnection(ctx, field.Selections, &res) } // nolint: vetshadow -func (ec *executionContext) _Person_avatarUrl(ctx context.Context, field graphql.CollectedField, obj *bug.Person) graphql.Marshaler { +func (ec *executionContext) _Repository_bug(ctx context.Context, field graphql.CollectedField, obj *models.Repository) graphql.Marshaler { + rawArgs := field.ArgumentMap(ec.Variables) + args, err := field_Repository_bug_args(rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } rctx := &graphql.ResolverContext{ - Object: "Person", - Args: nil, + Object: "Repository", + Args: args, Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { - return obj.AvatarUrl, nil + return ec.resolvers.Repository().Bug(ctx, obj, args["prefix"].(string)) }) if resTmp == nil { return graphql.Null } - res := resTmp.(string) + res := resTmp.(*bug.Snapshot) rctx.Result = res - return graphql.MarshalString(res) + + if res == nil { + return graphql.Null + } + + return ec._Bug(ctx, field.Selections, res) } -var queryImplementors = []string{"Query"} +var setStatusOperationImplementors = []string{"SetStatusOperation", "Operation", "Authored", "TimelineItem"} // nolint: gocyclo, errcheck, gas, goconst -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", - }) +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 out := graphql.NewOrderedMap(len(fields)) @@ -3702,23 +4505,39 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Query") - case "defaultRepository": + 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) { - out.Values[i] = ec._Query_defaultRepository(ctx, field) + out.Values[i] = ec._SetStatusOperation_author(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } wg.Done() }(i, field) - case "repository": + case "date": wg.Add(1) go func(i int, field graphql.CollectedField) { - out.Values[i] = ec._Query_repository(ctx, field) + out.Values[i] = ec._SetStatusOperation_date(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + wg.Done() + }(i, field) + case "status": + 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) - 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)) } @@ -3731,118 +4550,99 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } // nolint: vetshadow -func (ec *executionContext) _Query_defaultRepository(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { +func (ec *executionContext) _SetStatusOperation_hash(ctx context.Context, field graphql.CollectedField, obj *bug.SetStatusOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Query", + Object: "SetStatusOperation", 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) + 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.(*models.Repository) + res := resTmp.(git.Hash) rctx.Result = res - - if res == nil { - return graphql.Null - } - - return ec._Repository(ctx, field.Selections, res) + return res } // nolint: vetshadow -func (ec *executionContext) _Query_repository(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { - rawArgs := field.ArgumentMap(ec.Variables) - args, err := field_Query_repository_args(rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } +func (ec *executionContext) _SetStatusOperation_author(ctx context.Context, field graphql.CollectedField, obj *bug.SetStatusOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Query", - Args: args, + Object: "SetStatusOperation", + Args: nil, 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)) + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.SetStatusOperation().Author(ctx, obj) }) if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*models.Repository) + res := resTmp.(bug.Person) rctx.Result = res - if res == nil { - return graphql.Null - } - - return ec._Repository(ctx, field.Selections, res) + return ec._Person(ctx, field.Selections, &res) } // nolint: vetshadow -func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { - rawArgs := field.ArgumentMap(ec.Variables) - args, err := field_Query___type_args(rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } +func (ec *executionContext) _SetStatusOperation_date(ctx context.Context, field graphql.CollectedField, obj *bug.SetStatusOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Query", - Args: args, + Object: "SetStatusOperation", + Args: nil, 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 + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.SetStatusOperation().Date(ctx, obj) }) if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(time.Time) rctx.Result = res - - if res == nil { - return graphql.Null - } - - return ec.___Type(ctx, field.Selections, res) + return graphql.MarshalTime(res) } // nolint: vetshadow -func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { +func (ec *executionContext) _SetStatusOperation_status(ctx context.Context, field graphql.CollectedField, obj *bug.SetStatusOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Query", + Object: "SetStatusOperation", Args: nil, Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) - resTmp := ec.FieldMiddleware(ctx, nil, func(ctx context.Context) (interface{}, error) { - return ec.introspectSchema(), nil + resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.SetStatusOperation().Status(ctx, obj) }) if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*introspection.Schema) + res := resTmp.(models.Status) rctx.Result = res - - if res == nil { - return graphql.Null - } - - return ec.___Schema(ctx, field.Selections, res) + return res } -var repositoryImplementors = []string{"Repository"} +var setTitleOperationImplementors = []string{"SetTitleOperation", "Operation", "Authored", "TimelineItem"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _Repository(ctx context.Context, sel ast.SelectionSet, obj *models.Repository) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, repositoryImplementors) +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 out := graphql.NewOrderedMap(len(fields)) @@ -3852,22 +4652,40 @@ func (ec *executionContext) _Repository(ctx context.Context, sel ast.SelectionSe switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Repository") - case "allBugs": + 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) { - out.Values[i] = ec._Repository_allBugs(ctx, field, obj) + out.Values[i] = ec._SetTitleOperation_author(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } wg.Done() }(i, field) - case "bug": + case "date": wg.Add(1) go func(i int, field graphql.CollectedField) { - out.Values[i] = ec._Repository_bug(ctx, field, obj) + 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)) } @@ -3880,21 +4698,37 @@ func (ec *executionContext) _Repository(ctx context.Context, sel ast.SelectionSe } // nolint: vetshadow -func (ec *executionContext) _Repository_allBugs(ctx context.Context, field graphql.CollectedField, obj *models.Repository) graphql.Marshaler { - rawArgs := field.ArgumentMap(ec.Variables) - args, err := field_Repository_allBugs_args(rawArgs) - if err != nil { - ec.Error(ctx, err) +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: "Repository", - Args: args, + 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.Repository().AllBugs(ctx, obj, args["after"].(*string), args["before"].(*string), args["first"].(*int), args["last"].(*int), args["query"].(*string)) + return ec.resolvers.SetTitleOperation().Author(ctx, obj) }) if resTmp == nil { if !ec.HasError(rctx) { @@ -3902,49 +4736,84 @@ func (ec *executionContext) _Repository_allBugs(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(models.BugConnection) + res := resTmp.(bug.Person) rctx.Result = res - return ec._BugConnection(ctx, field.Selections, &res) + return ec._Person(ctx, field.Selections, &res) } // nolint: vetshadow -func (ec *executionContext) _Repository_bug(ctx context.Context, field graphql.CollectedField, obj *models.Repository) graphql.Marshaler { - rawArgs := field.ArgumentMap(ec.Variables) - args, err := field_Repository_bug_args(rawArgs) - if err != nil { - ec.Error(ctx, err) +func (ec *executionContext) _SetTitleOperation_date(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 ec.resolvers.SetTitleOperation().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) +} + +// nolint: vetshadow +func (ec *executionContext) _SetTitleOperation_title(ctx context.Context, field graphql.CollectedField, obj *bug.SetTitleOperation) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Repository", - Args: args, + 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.Repository().Bug(ctx, obj, args["prefix"].(string)) + return obj.Title, nil }) if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*bug.Snapshot) + res := resTmp.(string) rctx.Result = res + return graphql.MarshalString(res) +} - if res == nil { +// nolint: vetshadow +func (ec *executionContext) _SetTitleOperation_was(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.Was, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - - return ec._Bug(ctx, field.Selections, res) + res := resTmp.(string) + rctx.Result = res + return graphql.MarshalString(res) } -var setStatusOperationImplementors = []string{"SetStatusOperation", "Operation", "Authored"} +var timelineItemConnectionImplementors = []string{"TimelineItemConnection"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _SetStatusOperation(ctx context.Context, sel ast.SelectionSet, obj *bug.SetStatusOperation) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, setStatusOperationImplementors) +func (ec *executionContext) _TimelineItemConnection(ctx context.Context, sel ast.SelectionSet, obj *models.TimelineItemConnection) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, timelineItemConnectionImplementors) - var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -3952,39 +4821,32 @@ func (ec *executionContext) _SetStatusOperation(ctx context.Context, sel ast.Sel switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("SetStatusOperation") - case "author": - wg.Add(1) - go func(i int, field graphql.CollectedField) { - out.Values[i] = ec._SetStatusOperation_author(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalid = true - } - wg.Done() - }(i, field) - case "date": - 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": - 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) + 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)) } } - wg.Wait() + if invalid { return graphql.Null } @@ -3992,15 +4854,15 @@ func (ec *executionContext) _SetStatusOperation(ctx context.Context, sel ast.Sel } // nolint: vetshadow -func (ec *executionContext) _SetStatusOperation_author(ctx context.Context, field graphql.CollectedField, obj *bug.SetStatusOperation) graphql.Marshaler { +func (ec *executionContext) _TimelineItemConnection_edges(ctx context.Context, field graphql.CollectedField, obj *models.TimelineItemConnection) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "SetStatusOperation", + Object: "TimelineItemConnection", Args: nil, Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.SetStatusOperation().Author(ctx, obj) + return obj.Edges, nil }) if resTmp == nil { if !ec.HasError(rctx) { @@ -4008,44 +4870,54 @@ func (ec *executionContext) _SetStatusOperation_author(ctx context.Context, fiel } return graphql.Null } - res := resTmp.(bug.Person) + res := resTmp.([]models.TimelineItemEdge) rctx.Result = res - return ec._Person(ctx, field.Selections, &res) -} + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup -// nolint: vetshadow -func (ec *executionContext) _SetStatusOperation_date(ctx context.Context, field graphql.CollectedField, obj *bug.SetStatusOperation) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Object: "SetStatusOperation", - Args: nil, - Field: field, + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) } - ctx = graphql.WithResolverContext(ctx, rctx) - resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.SetStatusOperation().Date(ctx, obj) - }) - if resTmp == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") + + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], } - return graphql.Null + 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) + } + } - res := resTmp.(time.Time) - rctx.Result = res - return graphql.MarshalTime(res) + wg.Wait() + return arr1 } // nolint: vetshadow -func (ec *executionContext) _SetStatusOperation_status(ctx context.Context, field graphql.CollectedField, obj *bug.SetStatusOperation) graphql.Marshaler { +func (ec *executionContext) _TimelineItemConnection_nodes(ctx context.Context, field graphql.CollectedField, obj *models.TimelineItemConnection) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "SetStatusOperation", + Object: "TimelineItemConnection", 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 obj.Nodes, nil }) if resTmp == nil { if !ec.HasError(rctx) { @@ -4053,75 +4925,54 @@ func (ec *executionContext) _SetStatusOperation_status(ctx context.Context, fiel } return graphql.Null } - res := resTmp.(models.Status) + res := resTmp.([]bug.TimelineItem) rctx.Result = res - return res -} - -var setTitleOperationImplementors = []string{"SetTitleOperation", "Operation", "Authored"} - -// nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _SetTitleOperation(ctx context.Context, sel ast.SelectionSet, obj *bug.SetTitleOperation) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, setTitleOperationImplementors) + arr1 := make(graphql.Array, len(res)) 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("SetTitleOperation") - case "author": - wg.Add(1) - go func(i int, field graphql.CollectedField) { - out.Values[i] = ec._SetTitleOperation_author(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalid = true - } - wg.Done() - }(i, field) - case "date": - 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 + 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() } - default: - panic("unknown field " + strconv.Quote(field.Name)) + arr1[idx1] = func() graphql.Marshaler { + + return ec._TimelineItem(ctx, field.Selections, &res[idx1]) + }() + } + if isLen1 { + f(idx1) + } else { + go f(idx1) } + } wg.Wait() - if invalid { - return graphql.Null - } - return out + return arr1 } // nolint: vetshadow -func (ec *executionContext) _SetTitleOperation_author(ctx context.Context, field graphql.CollectedField, obj *bug.SetTitleOperation) graphql.Marshaler { +func (ec *executionContext) _TimelineItemConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *models.TimelineItemConnection) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "SetTitleOperation", + Object: "TimelineItemConnection", Args: nil, Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.SetTitleOperation().Author(ctx, obj) + return obj.PageInfo, nil }) if resTmp == nil { if !ec.HasError(rctx) { @@ -4129,22 +4980,22 @@ func (ec *executionContext) _SetTitleOperation_author(ctx context.Context, field } return graphql.Null } - res := resTmp.(bug.Person) + res := resTmp.(models.PageInfo) rctx.Result = res - return ec._Person(ctx, field.Selections, &res) + return ec._PageInfo(ctx, field.Selections, &res) } // nolint: vetshadow -func (ec *executionContext) _SetTitleOperation_date(ctx context.Context, field graphql.CollectedField, obj *bug.SetTitleOperation) graphql.Marshaler { +func (ec *executionContext) _TimelineItemConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *models.TimelineItemConnection) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "SetTitleOperation", + Object: "TimelineItemConnection", 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 obj.TotalCount, nil }) if resTmp == nil { if !ec.HasError(rctx) { @@ -4152,21 +5003,56 @@ func (ec *executionContext) _SetTitleOperation_date(ctx context.Context, field g } return graphql.Null } - res := resTmp.(time.Time) + res := resTmp.(int) rctx.Result = res - return graphql.MarshalTime(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) _SetTitleOperation_title(ctx context.Context, field graphql.CollectedField, obj *bug.SetTitleOperation) graphql.Marshaler { +func (ec *executionContext) _TimelineItemEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *models.TimelineItemEdge) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "SetTitleOperation", + Object: "TimelineItemEdge", Args: nil, Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { - return obj.Title, nil + return obj.Cursor, nil }) if resTmp == nil { if !ec.HasError(rctx) { @@ -4180,15 +5066,15 @@ func (ec *executionContext) _SetTitleOperation_title(ctx context.Context, field } // nolint: vetshadow -func (ec *executionContext) _SetTitleOperation_was(ctx context.Context, field graphql.CollectedField, obj *bug.SetTitleOperation) graphql.Marshaler { +func (ec *executionContext) _TimelineItemEdge_node(ctx context.Context, field graphql.CollectedField, obj *models.TimelineItemEdge) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "SetTitleOperation", + Object: "TimelineItemEdge", Args: nil, Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, obj, func(ctx context.Context) (interface{}, error) { - return obj.Was, nil + return obj.Node, nil }) if resTmp == nil { if !ec.HasError(rctx) { @@ -4196,9 +5082,10 @@ func (ec *executionContext) _SetTitleOperation_was(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(string) + res := resTmp.(bug.TimelineItem) rctx.Result = res - return graphql.MarshalString(res) + + return ec._TimelineItem(ctx, field.Selections, &res) } var __DirectiveImplementors = []string{"__Directive"} @@ -5515,16 +6402,35 @@ func (ec *executionContext) _Operation(ctx context.Context, sel ast.SelectionSet switch obj := (*obj).(type) { case nil: return graphql.Null - 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) + 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)) } @@ -5629,6 +6535,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.""" @@ -5646,7 +6557,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! @@ -5662,14 +6574,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! @@ -5677,6 +6591,30 @@ type LabelChangeOperation implements Operation & Authored { removed: [Label!]! } +type TimelineItemConnection { + edges: [TimelineItemEdge!]! + nodes: [TimelineItem!]! + pageInfo: PageInfo! + totalCount: Int! +} + +type TimelineItemEdge { + cursor: String! + node: TimelineItem! +} + +type CreateTimelineItem implements TimelineItem { + hash: Hash! + lastState: Comment! + history: [Comment!]! +} + +type CommentTimelineItem implements TimelineItem { + hash: Hash! + lastState: Comment! + history: [Comment!]! +} + """The connection type for Bug.""" type BugConnection { """A list of edges.""" @@ -5717,6 +6655,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 -- cgit