diff options
Diffstat (limited to 'api/graphql/graph')
-rw-r--r-- | api/graphql/graph/bug.generated.go | 102 | ||||
-rw-r--r-- | api/graphql/graph/identity.generated.go | 33 | ||||
-rw-r--r-- | api/graphql/graph/mutations.generated.go | 16 | ||||
-rw-r--r-- | api/graphql/graph/operations.generated.go | 193 | ||||
-rw-r--r-- | api/graphql/graph/prelude.generated.go | 11 | ||||
-rw-r--r-- | api/graphql/graph/root_.generated.go | 97 | ||||
-rw-r--r-- | api/graphql/graph/timeline.generated.go | 41 | ||||
-rw-r--r-- | api/graphql/graph/types.generated.go | 17 |
8 files changed, 244 insertions, 266 deletions
diff --git a/api/graphql/graph/bug.generated.go b/api/graphql/graph/bug.generated.go index 67af1933..ab9c6c34 100644 --- a/api/graphql/graph/bug.generated.go +++ b/api/graphql/graph/bug.generated.go @@ -15,6 +15,7 @@ import ( "github.com/MichaelMure/git-bug/api/graphql/models" "github.com/MichaelMure/git-bug/entities/bug" "github.com/MichaelMure/git-bug/entities/common" + "github.com/MichaelMure/git-bug/entity" "github.com/MichaelMure/git-bug/repository" "github.com/vektah/gqlparser/v2/ast" ) @@ -22,7 +23,6 @@ import ( // region ************************** generated!.gotpl ************************** type BugResolver interface { - ID(ctx context.Context, obj models.BugWrapper) (string, error) HumanID(ctx context.Context, obj models.BugWrapper) (string, error) Actors(ctx context.Context, obj models.BugWrapper, after *string, before *string, first *int, last *int) (*models.IdentityConnection, error) @@ -32,6 +32,7 @@ type BugResolver interface { Operations(ctx context.Context, obj models.BugWrapper, after *string, before *string, first *int, last *int) (*models.OperationConnection, error) } type CommentResolver interface { + ID(ctx context.Context, obj *bug.Comment) (entity.CombinedId, error) Author(ctx context.Context, obj *bug.Comment) (models.IdentityWrapper, error) } @@ -271,7 +272,7 @@ func (ec *executionContext) _Bug_id(ctx context.Context, field graphql.Collected }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Bug().ID(rctx, obj) + return obj.Id(), nil }) if err != nil { ec.Error(ctx, err) @@ -283,9 +284,9 @@ func (ec *executionContext) _Bug_id(ctx context.Context, field graphql.Collected } return graphql.Null } - res := resTmp.(string) + res := resTmp.(entity.Id) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentityᚐId(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_Bug_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -293,9 +294,9 @@ func (ec *executionContext) fieldContext_Bug_id(ctx context.Context, field graph Object: "Bug", Field: field, IsMethod: true, - IsResolver: true, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil @@ -1294,6 +1295,50 @@ func (ec *executionContext) fieldContext_BugEdge_node(ctx context.Context, field return fc, nil } +func (ec *executionContext) _Comment_id(ctx context.Context, field graphql.CollectedField, obj *bug.Comment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Comment_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Comment().ID(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entity.CombinedId) + fc.Result = res + return ec.marshalNCombinedId2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentityᚐCombinedId(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Comment_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Comment", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type CombinedId does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _Comment_author(ctx context.Context, field graphql.CollectedField, obj *bug.Comment) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Comment_author(ctx, field) if err != nil { @@ -1533,6 +1578,8 @@ func (ec *executionContext) fieldContext_CommentConnection_nodes(ctx context.Con IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { + case "id": + return ec.fieldContext_Comment_id(ctx, field) case "author": return ec.fieldContext_Comment_author(ctx, field) case "message": @@ -1727,6 +1774,8 @@ func (ec *executionContext) fieldContext_CommentEdge_node(ctx context.Context, f IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { + case "id": + return ec.fieldContext_Comment_id(ctx, field) case "author": return ec.fieldContext_Comment_author(ctx, field) case "message": @@ -1763,25 +1812,12 @@ func (ec *executionContext) _Bug(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("Bug") case "id": - field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Bug_id(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + out.Values[i] = ec._Bug_id(ctx, field, obj) - }) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } case "humanId": field := field @@ -2049,6 +2085,26 @@ func (ec *executionContext) _Comment(ctx context.Context, sel ast.SelectionSet, switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Comment") + case "id": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Comment_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) case "author": field := field diff --git a/api/graphql/graph/identity.generated.go b/api/graphql/graph/identity.generated.go index 7fa9b9f0..51aa188b 100644 --- a/api/graphql/graph/identity.generated.go +++ b/api/graphql/graph/identity.generated.go @@ -12,13 +12,13 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/MichaelMure/git-bug/api/graphql/models" + "github.com/MichaelMure/git-bug/entity" "github.com/vektah/gqlparser/v2/ast" ) // region ************************** generated!.gotpl ************************** type IdentityResolver interface { - ID(ctx context.Context, obj models.IdentityWrapper) (string, error) HumanID(ctx context.Context, obj models.IdentityWrapper) (string, error) } @@ -48,7 +48,7 @@ func (ec *executionContext) _Identity_id(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Identity().ID(rctx, obj) + return obj.Id(), nil }) if err != nil { ec.Error(ctx, err) @@ -60,9 +60,9 @@ func (ec *executionContext) _Identity_id(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.(string) + res := resTmp.(entity.Id) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentityᚐId(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_Identity_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -70,9 +70,9 @@ func (ec *executionContext) fieldContext_Identity_id(ctx context.Context, field Object: "Identity", Field: field, IsMethod: true, - IsResolver: true, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil @@ -713,25 +713,12 @@ func (ec *executionContext) _Identity(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("Identity") case "id": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Identity_id(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + out.Values[i] = ec._Identity_id(ctx, field, obj) - }) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } case "humanId": field := field diff --git a/api/graphql/graph/mutations.generated.go b/api/graphql/graph/mutations.generated.go index 9d5df56e..11604d11 100644 --- a/api/graphql/graph/mutations.generated.go +++ b/api/graphql/graph/mutations.generated.go @@ -2097,7 +2097,7 @@ func (ec *executionContext) unmarshalInputEditCommentInput(ctx context.Context, asMap[k] = v } - fieldsInOrder := [...]string{"clientMutationId", "repoRef", "prefix", "target", "message", "files"} + fieldsInOrder := [...]string{"clientMutationId", "repoRef", "targetPrefix", "message", "files"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -2120,19 +2120,11 @@ func (ec *executionContext) unmarshalInputEditCommentInput(ctx context.Context, if err != nil { return it, err } - case "prefix": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("prefix")) - it.Prefix, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "target": + case "targetPrefix": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("target")) - it.Target, err = ec.unmarshalNString2string(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetPrefix")) + it.TargetPrefix, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } diff --git a/api/graphql/graph/operations.generated.go b/api/graphql/graph/operations.generated.go index 39a216f4..cc3cd9b7 100644 --- a/api/graphql/graph/operations.generated.go +++ b/api/graphql/graph/operations.generated.go @@ -15,6 +15,7 @@ import ( "github.com/MichaelMure/git-bug/api/graphql/models" "github.com/MichaelMure/git-bug/entities/bug" "github.com/MichaelMure/git-bug/entities/common" + "github.com/MichaelMure/git-bug/entity" "github.com/MichaelMure/git-bug/entity/dag" "github.com/MichaelMure/git-bug/repository" "github.com/vektah/gqlparser/v2/ast" @@ -23,33 +24,27 @@ import ( // region ************************** generated!.gotpl ************************** type AddCommentOperationResolver interface { - ID(ctx context.Context, obj *bug.AddCommentOperation) (string, error) Author(ctx context.Context, obj *bug.AddCommentOperation) (models.IdentityWrapper, error) Date(ctx context.Context, obj *bug.AddCommentOperation) (*time.Time, error) } type CreateOperationResolver interface { - ID(ctx context.Context, obj *bug.CreateOperation) (string, error) Author(ctx context.Context, obj *bug.CreateOperation) (models.IdentityWrapper, error) Date(ctx context.Context, obj *bug.CreateOperation) (*time.Time, error) } type EditCommentOperationResolver interface { - ID(ctx context.Context, obj *bug.EditCommentOperation) (string, error) Author(ctx context.Context, obj *bug.EditCommentOperation) (models.IdentityWrapper, error) Date(ctx context.Context, obj *bug.EditCommentOperation) (*time.Time, error) Target(ctx context.Context, obj *bug.EditCommentOperation) (string, error) } type LabelChangeOperationResolver interface { - ID(ctx context.Context, obj *bug.LabelChangeOperation) (string, error) Author(ctx context.Context, obj *bug.LabelChangeOperation) (models.IdentityWrapper, error) Date(ctx context.Context, obj *bug.LabelChangeOperation) (*time.Time, error) } type SetStatusOperationResolver interface { - ID(ctx context.Context, obj *bug.SetStatusOperation) (string, error) Author(ctx context.Context, obj *bug.SetStatusOperation) (models.IdentityWrapper, error) Date(ctx context.Context, obj *bug.SetStatusOperation) (*time.Time, error) } type SetTitleOperationResolver interface { - ID(ctx context.Context, obj *bug.SetTitleOperation) (string, error) Author(ctx context.Context, obj *bug.SetTitleOperation) (models.IdentityWrapper, error) Date(ctx context.Context, obj *bug.SetTitleOperation) (*time.Time, error) } @@ -80,7 +75,7 @@ func (ec *executionContext) _AddCommentOperation_id(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.AddCommentOperation().ID(rctx, obj) + return obj.Id(), nil }) if err != nil { ec.Error(ctx, err) @@ -92,9 +87,9 @@ func (ec *executionContext) _AddCommentOperation_id(ctx context.Context, field g } return graphql.Null } - res := resTmp.(string) + res := resTmp.(entity.Id) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentityᚐId(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_AddCommentOperation_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -102,9 +97,9 @@ func (ec *executionContext) fieldContext_AddCommentOperation_id(ctx context.Cont Object: "AddCommentOperation", Field: field, IsMethod: true, - IsResolver: true, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil @@ -318,7 +313,7 @@ func (ec *executionContext) _CreateOperation_id(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.CreateOperation().ID(rctx, obj) + return obj.Id(), nil }) if err != nil { ec.Error(ctx, err) @@ -330,9 +325,9 @@ func (ec *executionContext) _CreateOperation_id(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(string) + res := resTmp.(entity.Id) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentityᚐId(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_CreateOperation_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -340,9 +335,9 @@ func (ec *executionContext) fieldContext_CreateOperation_id(ctx context.Context, Object: "CreateOperation", Field: field, IsMethod: true, - IsResolver: true, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil @@ -600,7 +595,7 @@ func (ec *executionContext) _EditCommentOperation_id(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.EditCommentOperation().ID(rctx, obj) + return obj.Id(), nil }) if err != nil { ec.Error(ctx, err) @@ -612,9 +607,9 @@ func (ec *executionContext) _EditCommentOperation_id(ctx context.Context, field } return graphql.Null } - res := resTmp.(string) + res := resTmp.(entity.Id) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentityᚐId(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_EditCommentOperation_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -622,9 +617,9 @@ func (ec *executionContext) fieldContext_EditCommentOperation_id(ctx context.Con Object: "EditCommentOperation", Field: field, IsMethod: true, - IsResolver: true, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil @@ -882,7 +877,7 @@ func (ec *executionContext) _LabelChangeOperation_id(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.LabelChangeOperation().ID(rctx, obj) + return obj.Id(), nil }) if err != nil { ec.Error(ctx, err) @@ -894,9 +889,9 @@ func (ec *executionContext) _LabelChangeOperation_id(ctx context.Context, field } return graphql.Null } - res := resTmp.(string) + res := resTmp.(entity.Id) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentityᚐId(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_LabelChangeOperation_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -904,9 +899,9 @@ func (ec *executionContext) fieldContext_LabelChangeOperation_id(ctx context.Con Object: "LabelChangeOperation", Field: field, IsMethod: true, - IsResolver: true, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil @@ -1412,7 +1407,7 @@ func (ec *executionContext) _SetStatusOperation_id(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.SetStatusOperation().ID(rctx, obj) + return obj.Id(), nil }) if err != nil { ec.Error(ctx, err) @@ -1424,9 +1419,9 @@ func (ec *executionContext) _SetStatusOperation_id(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(string) + res := resTmp.(entity.Id) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentityᚐId(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_SetStatusOperation_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -1434,9 +1429,9 @@ func (ec *executionContext) fieldContext_SetStatusOperation_id(ctx context.Conte Object: "SetStatusOperation", Field: field, IsMethod: true, - IsResolver: true, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil @@ -1606,7 +1601,7 @@ func (ec *executionContext) _SetTitleOperation_id(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.SetTitleOperation().ID(rctx, obj) + return obj.Id(), nil }) if err != nil { ec.Error(ctx, err) @@ -1618,9 +1613,9 @@ func (ec *executionContext) _SetTitleOperation_id(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(string) + res := resTmp.(entity.Id) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentityᚐId(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_SetTitleOperation_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -1628,9 +1623,9 @@ func (ec *executionContext) fieldContext_SetTitleOperation_id(ctx context.Contex Object: "SetTitleOperation", Field: field, IsMethod: true, - IsResolver: true, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil @@ -1892,25 +1887,12 @@ func (ec *executionContext) _AddCommentOperation(ctx context.Context, sel ast.Se case "__typename": out.Values[i] = graphql.MarshalString("AddCommentOperation") case "id": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._AddCommentOperation_id(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + out.Values[i] = ec._AddCommentOperation_id(ctx, field, obj) - }) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } case "author": field := field @@ -1987,25 +1969,12 @@ func (ec *executionContext) _CreateOperation(ctx context.Context, sel ast.Select case "__typename": out.Values[i] = graphql.MarshalString("CreateOperation") case "id": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._CreateOperation_id(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + out.Values[i] = ec._CreateOperation_id(ctx, field, obj) - }) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } case "author": field := field @@ -2089,25 +2058,12 @@ func (ec *executionContext) _EditCommentOperation(ctx context.Context, sel ast.S case "__typename": out.Values[i] = graphql.MarshalString("EditCommentOperation") case "id": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._EditCommentOperation_id(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + out.Values[i] = ec._EditCommentOperation_id(ctx, field, obj) - }) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } case "author": field := field @@ -2204,25 +2160,12 @@ func (ec *executionContext) _LabelChangeOperation(ctx context.Context, sel ast.S case "__typename": out.Values[i] = graphql.MarshalString("LabelChangeOperation") case "id": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._LabelChangeOperation_id(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + out.Values[i] = ec._LabelChangeOperation_id(ctx, field, obj) - }) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } case "author": field := field @@ -2383,25 +2326,12 @@ func (ec *executionContext) _SetStatusOperation(ctx context.Context, sel ast.Sel case "__typename": out.Values[i] = graphql.MarshalString("SetStatusOperation") case "id": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._SetStatusOperation_id(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + out.Values[i] = ec._SetStatusOperation_id(ctx, field, obj) - }) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } case "author": field := field @@ -2471,25 +2401,12 @@ func (ec *executionContext) _SetTitleOperation(ctx context.Context, sel ast.Sele case "__typename": out.Values[i] = graphql.MarshalString("SetTitleOperation") case "id": - field := field - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._SetTitleOperation_id(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + out.Values[i] = ec._SetTitleOperation_id(ctx, field, obj) - }) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } case "author": field := field diff --git a/api/graphql/graph/prelude.generated.go b/api/graphql/graph/prelude.generated.go index 81978efa..3767b0cd 100644 --- a/api/graphql/graph/prelude.generated.go +++ b/api/graphql/graph/prelude.generated.go @@ -11,6 +11,7 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/introspection" + "github.com/MichaelMure/git-bug/entity" "github.com/vektah/gqlparser/v2/ast" ) @@ -2172,6 +2173,16 @@ func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.Se return res } +func (ec *executionContext) unmarshalNID2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentityᚐId(ctx context.Context, v interface{}) (entity.Id, error) { + var res entity.Id + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNID2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentityᚐId(ctx context.Context, sel ast.SelectionSet, v entity.Id) graphql.Marshaler { + return v +} + func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v interface{}) (int, error) { res, err := graphql.UnmarshalInt(v) return res, graphql.ErrorOnPath(ctx, err) diff --git a/api/graphql/graph/root_.generated.go b/api/graphql/graph/root_.generated.go index 297fc6a2..a1434228 100644 --- a/api/graphql/graph/root_.generated.go +++ b/api/graphql/graph/root_.generated.go @@ -74,7 +74,7 @@ type ComplexityRoot struct { Author func(childComplexity int) int Date func(childComplexity int) int Files func(childComplexity int) int - ID func(childComplexity int) int + Id func(childComplexity int) int Message func(childComplexity int) int } @@ -102,7 +102,7 @@ type ComplexityRoot struct { Comments func(childComplexity int, after *string, before *string, first *int, last *int) int CreatedAt func(childComplexity int) int HumanID func(childComplexity int) int - ID func(childComplexity int) int + Id func(childComplexity int) int Labels func(childComplexity int) int LastEdit func(childComplexity int) int Operations func(childComplexity int, after *string, before *string, first *int, last *int) int @@ -146,6 +146,7 @@ type ComplexityRoot struct { Comment struct { Author func(childComplexity int) int Files func(childComplexity int) int + ID func(childComplexity int) int Message func(childComplexity int) int } @@ -170,7 +171,7 @@ type ComplexityRoot struct { Author func(childComplexity int) int Date func(childComplexity int) int Files func(childComplexity int) int - ID func(childComplexity int) int + Id func(childComplexity int) int Message func(childComplexity int) int Title func(childComplexity int) int } @@ -191,7 +192,7 @@ type ComplexityRoot struct { Author func(childComplexity int) int Date func(childComplexity int) int Files func(childComplexity int) int - ID func(childComplexity int) int + Id func(childComplexity int) int Message func(childComplexity int) int Target func(childComplexity int) int } @@ -207,7 +208,7 @@ type ComplexityRoot struct { DisplayName func(childComplexity int) int Email func(childComplexity int) int HumanID func(childComplexity int) int - ID func(childComplexity int) int + Id func(childComplexity int) int IsProtected func(childComplexity int) int Login func(childComplexity int) int Name func(childComplexity int) int @@ -234,7 +235,7 @@ type ComplexityRoot struct { Added func(childComplexity int) int Author func(childComplexity int) int Date func(childComplexity int) int - ID func(childComplexity int) int + Id func(childComplexity int) int Removed func(childComplexity int) int } @@ -323,7 +324,7 @@ type ComplexityRoot struct { SetStatusOperation struct { Author func(childComplexity int) int Date func(childComplexity int) int - ID func(childComplexity int) int + Id func(childComplexity int) int Status func(childComplexity int) int } @@ -337,7 +338,7 @@ type ComplexityRoot struct { SetTitleOperation struct { Author func(childComplexity int) int Date func(childComplexity int) int - ID func(childComplexity int) int + Id func(childComplexity int) int Title func(childComplexity int) int Was func(childComplexity int) int } @@ -462,11 +463,11 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.AddCommentOperation.Files(childComplexity), true case "AddCommentOperation.id": - if e.complexity.AddCommentOperation.ID == nil { + if e.complexity.AddCommentOperation.Id == nil { break } - return e.complexity.AddCommentOperation.ID(childComplexity), true + return e.complexity.AddCommentOperation.Id(childComplexity), true case "AddCommentOperation.message": if e.complexity.AddCommentOperation.Message == nil { @@ -605,11 +606,11 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Bug.HumanID(childComplexity), true case "Bug.id": - if e.complexity.Bug.ID == nil { + if e.complexity.Bug.Id == nil { break } - return e.complexity.Bug.ID(childComplexity), true + return e.complexity.Bug.Id(childComplexity), true case "Bug.labels": if e.complexity.Bug.Labels == nil { @@ -801,6 +802,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Comment.Files(childComplexity), true + case "Comment.id": + if e.complexity.Comment.ID == nil { + break + } + + return e.complexity.Comment.ID(childComplexity), true + case "Comment.message": if e.complexity.Comment.Message == nil { break @@ -886,11 +894,11 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.CreateOperation.Files(childComplexity), true case "CreateOperation.id": - if e.complexity.CreateOperation.ID == nil { + if e.complexity.CreateOperation.Id == nil { break } - return e.complexity.CreateOperation.ID(childComplexity), true + return e.complexity.CreateOperation.Id(childComplexity), true case "CreateOperation.message": if e.complexity.CreateOperation.Message == nil { @@ -991,11 +999,11 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.EditCommentOperation.Files(childComplexity), true case "EditCommentOperation.id": - if e.complexity.EditCommentOperation.ID == nil { + if e.complexity.EditCommentOperation.Id == nil { break } - return e.complexity.EditCommentOperation.ID(childComplexity), true + return e.complexity.EditCommentOperation.Id(childComplexity), true case "EditCommentOperation.message": if e.complexity.EditCommentOperation.Message == nil { @@ -1061,11 +1069,11 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Identity.HumanID(childComplexity), true case "Identity.id": - if e.complexity.Identity.ID == nil { + if e.complexity.Identity.Id == nil { break } - return e.complexity.Identity.ID(childComplexity), true + return e.complexity.Identity.Id(childComplexity), true case "Identity.isProtected": if e.complexity.Identity.IsProtected == nil { @@ -1166,11 +1174,11 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.LabelChangeOperation.Date(childComplexity), true case "LabelChangeOperation.id": - if e.complexity.LabelChangeOperation.ID == nil { + if e.complexity.LabelChangeOperation.Id == nil { break } - return e.complexity.LabelChangeOperation.ID(childComplexity), true + return e.complexity.LabelChangeOperation.Id(childComplexity), true case "LabelChangeOperation.removed": if e.complexity.LabelChangeOperation.Removed == nil { @@ -1591,11 +1599,11 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.SetStatusOperation.Date(childComplexity), true case "SetStatusOperation.id": - if e.complexity.SetStatusOperation.ID == nil { + if e.complexity.SetStatusOperation.Id == nil { break } - return e.complexity.SetStatusOperation.ID(childComplexity), true + return e.complexity.SetStatusOperation.Id(childComplexity), true case "SetStatusOperation.status": if e.complexity.SetStatusOperation.Status == nil { @@ -1647,11 +1655,11 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.SetTitleOperation.Date(childComplexity), true case "SetTitleOperation.id": - if e.complexity.SetTitleOperation.ID == nil { + if e.complexity.SetTitleOperation.Id == nil { break } - return e.complexity.SetTitleOperation.ID(childComplexity), true + return e.complexity.SetTitleOperation.Id(childComplexity), true case "SetTitleOperation.title": if e.complexity.SetTitleOperation.Title == nil { @@ -1844,6 +1852,8 @@ func (ec *executionContext) introspectType(name string) (*introspection.Type, er var sources = []*ast.Source{ {Name: "../schema/bug.graphql", Input: `"""Represents a comment on a bug.""" type Comment implements Authored { + id: CombinedId! + """The author of this comment.""" author: Identity! @@ -1873,7 +1883,7 @@ enum Status { type Bug implements Authored { """The identifier for this bug""" - id: String! + id: ID! """The human version (truncated) identifier for this bug""" humanId: String! status: Status! @@ -1964,7 +1974,7 @@ type BugEdge { {Name: "../schema/identity.graphql", Input: `"""Represents an identity""" type Identity { """The identifier for this identity""" - id: String! + id: ID! """The human version (truncated) identifier for this identity""" humanId: String! """The name of the person, if known.""" @@ -2109,10 +2119,8 @@ input EditCommentInput { clientMutationId: String """The name of the repository. If not set, the default repository is used.""" repoRef: String - """The bug ID's prefix.""" - prefix: String! - """The ID of the comment to be changed.""" - target: String! + """A prefix of the CombinedId of the comment to be changed.""" + targetPrefix: String! """The new message to be set.""" message: String! """The collection of file's hash required for the first message.""" @@ -2226,7 +2234,7 @@ type SetTitlePayload { {Name: "../schema/operations.graphql", Input: `"""An operation applied to a bug.""" interface Operation { """The identifier of the operation""" - id: String! + id: ID! """The operations author.""" author: Identity! """The datetime when this operation was issued.""" @@ -2253,7 +2261,7 @@ type OperationEdge { type CreateOperation implements Operation & Authored { """The identifier of the operation""" - id: String! + id: ID! """The author of this object.""" author: Identity! """The datetime when this operation was issued.""" @@ -2266,7 +2274,7 @@ type CreateOperation implements Operation & Authored { type SetTitleOperation implements Operation & Authored { """The identifier of the operation""" - id: String! + id: ID! """The author of this object.""" author: Identity! """The datetime when this operation was issued.""" @@ -2278,7 +2286,7 @@ type SetTitleOperation implements Operation & Authored { type AddCommentOperation implements Operation & Authored { """The identifier of the operation""" - id: String! + id: ID! """The author of this object.""" author: Identity! """The datetime when this operation was issued.""" @@ -2290,7 +2298,7 @@ type AddCommentOperation implements Operation & Authored { type EditCommentOperation implements Operation & Authored { """The identifier of the operation""" - id: String! + id: ID! """The author of this object.""" author: Identity! """The datetime when this operation was issued.""" @@ -2303,7 +2311,7 @@ type EditCommentOperation implements Operation & Authored { type SetStatusOperation implements Operation & Authored { """The identifier of the operation""" - id: String! + id: ID! """The author of this object.""" author: Identity! """The datetime when this operation was issued.""" @@ -2314,7 +2322,7 @@ type SetStatusOperation implements Operation & Authored { type LabelChangeOperation implements Operation & Authored { """The identifier of the operation""" - id: String! + id: ID! """The author of this object.""" author: Identity! """The datetime when this operation was issued.""" @@ -2404,7 +2412,7 @@ type Mutation { {Name: "../schema/timeline.graphql", Input: `"""An item in the timeline of events""" interface TimelineItem { """The identifier of the source operation""" - id: String! + id: CombinedId! } """CommentHistoryStep hold one version of a message in the history""" @@ -2434,7 +2442,7 @@ type TimelineItemEdge { """CreateTimelineItem is a TimelineItem that represent the creation of a bug and its message edition history""" type CreateTimelineItem implements TimelineItem & Authored { """The identifier of the source operation""" - id: String! + id: CombinedId! author: Identity! message: String! messageIsEmpty: Boolean! @@ -2448,7 +2456,7 @@ type CreateTimelineItem implements TimelineItem & Authored { """AddCommentTimelineItem is a TimelineItem that represent a Comment and its edition history""" type AddCommentTimelineItem implements TimelineItem & Authored { """The identifier of the source operation""" - id: String! + id: CombinedId! author: Identity! message: String! messageIsEmpty: Boolean! @@ -2462,7 +2470,7 @@ type AddCommentTimelineItem implements TimelineItem & Authored { """LabelChangeTimelineItem is a TimelineItem that represent a change in the labels of a bug""" type LabelChangeTimelineItem implements TimelineItem & Authored { """The identifier of the source operation""" - id: String! + id: CombinedId! author: Identity! date: Time! added: [Label!]! @@ -2472,7 +2480,7 @@ type LabelChangeTimelineItem implements TimelineItem & Authored { """SetStatusTimelineItem is a TimelineItem that represent a change in the status of a bug""" type SetStatusTimelineItem implements TimelineItem & Authored { """The identifier of the source operation""" - id: String! + id: CombinedId! author: Identity! date: Time! status: Status! @@ -2481,14 +2489,15 @@ type SetStatusTimelineItem implements TimelineItem & Authored { """LabelChangeTimelineItem is a TimelineItem that represent a change in the title of a bug""" type SetTitleTimelineItem implements TimelineItem & Authored { """The identifier of the source operation""" - id: String! + id: CombinedId! author: Identity! date: Time! title: String! was: String! } `, BuiltIn: false}, - {Name: "../schema/types.graphql", Input: `scalar Time + {Name: "../schema/types.graphql", Input: `scalar CombinedId +scalar Time scalar Hash """Defines a color by red, green and blue components.""" diff --git a/api/graphql/graph/timeline.generated.go b/api/graphql/graph/timeline.generated.go index 9ad32e0b..4833e274 100644 --- a/api/graphql/graph/timeline.generated.go +++ b/api/graphql/graph/timeline.generated.go @@ -15,6 +15,7 @@ import ( "github.com/MichaelMure/git-bug/api/graphql/models" "github.com/MichaelMure/git-bug/entities/bug" "github.com/MichaelMure/git-bug/entities/common" + "github.com/MichaelMure/git-bug/entity" "github.com/MichaelMure/git-bug/repository" "github.com/vektah/gqlparser/v2/ast" ) @@ -22,7 +23,7 @@ import ( // region ************************** generated!.gotpl ************************** type AddCommentTimelineItemResolver interface { - ID(ctx context.Context, obj *bug.AddCommentTimelineItem) (string, error) + ID(ctx context.Context, obj *bug.AddCommentTimelineItem) (entity.CombinedId, error) Author(ctx context.Context, obj *bug.AddCommentTimelineItem) (models.IdentityWrapper, error) CreatedAt(ctx context.Context, obj *bug.AddCommentTimelineItem) (*time.Time, error) @@ -32,24 +33,24 @@ type CommentHistoryStepResolver interface { Date(ctx context.Context, obj *bug.CommentHistoryStep) (*time.Time, error) } type CreateTimelineItemResolver interface { - ID(ctx context.Context, obj *bug.CreateTimelineItem) (string, error) + ID(ctx context.Context, obj *bug.CreateTimelineItem) (entity.CombinedId, error) Author(ctx context.Context, obj *bug.CreateTimelineItem) (models.IdentityWrapper, error) CreatedAt(ctx context.Context, obj *bug.CreateTimelineItem) (*time.Time, error) LastEdit(ctx context.Context, obj *bug.CreateTimelineItem) (*time.Time, error) } type LabelChangeTimelineItemResolver interface { - ID(ctx context.Context, obj *bug.LabelChangeTimelineItem) (string, error) + ID(ctx context.Context, obj *bug.LabelChangeTimelineItem) (entity.CombinedId, error) Author(ctx context.Context, obj *bug.LabelChangeTimelineItem) (models.IdentityWrapper, error) Date(ctx context.Context, obj *bug.LabelChangeTimelineItem) (*time.Time, error) } type SetStatusTimelineItemResolver interface { - ID(ctx context.Context, obj *bug.SetStatusTimelineItem) (string, error) + ID(ctx context.Context, obj *bug.SetStatusTimelineItem) (entity.CombinedId, error) Author(ctx context.Context, obj *bug.SetStatusTimelineItem) (models.IdentityWrapper, error) Date(ctx context.Context, obj *bug.SetStatusTimelineItem) (*time.Time, error) } type SetTitleTimelineItemResolver interface { - ID(ctx context.Context, obj *bug.SetTitleTimelineItem) (string, error) + ID(ctx context.Context, obj *bug.SetTitleTimelineItem) (entity.CombinedId, error) Author(ctx context.Context, obj *bug.SetTitleTimelineItem) (models.IdentityWrapper, error) Date(ctx context.Context, obj *bug.SetTitleTimelineItem) (*time.Time, error) } @@ -92,9 +93,9 @@ func (ec *executionContext) _AddCommentTimelineItem_id(ctx context.Context, fiel } return graphql.Null } - res := resTmp.(string) + res := resTmp.(entity.CombinedId) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNCombinedId2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentityᚐCombinedId(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_AddCommentTimelineItem_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -104,7 +105,7 @@ func (ec *executionContext) fieldContext_AddCommentTimelineItem_id(ctx context.C IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type CombinedId does not have child fields") }, } return fc, nil @@ -600,9 +601,9 @@ func (ec *executionContext) _CreateTimelineItem_id(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(string) + res := resTmp.(entity.CombinedId) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNCombinedId2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentityᚐCombinedId(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_CreateTimelineItem_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -612,7 +613,7 @@ func (ec *executionContext) fieldContext_CreateTimelineItem_id(ctx context.Conte IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type CombinedId does not have child fields") }, } return fc, nil @@ -1020,9 +1021,9 @@ func (ec *executionContext) _LabelChangeTimelineItem_id(ctx context.Context, fie } return graphql.Null } - res := resTmp.(string) + res := resTmp.(entity.CombinedId) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNCombinedId2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentityᚐCombinedId(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_LabelChangeTimelineItem_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -1032,7 +1033,7 @@ func (ec *executionContext) fieldContext_LabelChangeTimelineItem_id(ctx context. IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type CombinedId does not have child fields") }, } return fc, nil @@ -1270,9 +1271,9 @@ func (ec *executionContext) _SetStatusTimelineItem_id(ctx context.Context, field } return graphql.Null } - res := resTmp.(string) + res := resTmp.(entity.CombinedId) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNCombinedId2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentityᚐCombinedId(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_SetStatusTimelineItem_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -1282,7 +1283,7 @@ func (ec *executionContext) fieldContext_SetStatusTimelineItem_id(ctx context.Co IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type CombinedId does not have child fields") }, } return fc, nil @@ -1464,9 +1465,9 @@ func (ec *executionContext) _SetTitleTimelineItem_id(ctx context.Context, field } return graphql.Null } - res := resTmp.(string) + res := resTmp.(entity.CombinedId) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNCombinedId2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentityᚐCombinedId(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_SetTitleTimelineItem_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -1476,7 +1477,7 @@ func (ec *executionContext) fieldContext_SetTitleTimelineItem_id(ctx context.Con IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type CombinedId does not have child fields") }, } return fc, nil diff --git a/api/graphql/graph/types.generated.go b/api/graphql/graph/types.generated.go index 9095c7ac..b75604ab 100644 --- a/api/graphql/graph/types.generated.go +++ b/api/graphql/graph/types.generated.go @@ -14,6 +14,7 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/MichaelMure/git-bug/api/graphql/models" "github.com/MichaelMure/git-bug/entities/bug" + "github.com/MichaelMure/git-bug/entity" "github.com/MichaelMure/git-bug/repository" "github.com/vektah/gqlparser/v2/ast" ) @@ -410,22 +411,16 @@ func (ec *executionContext) _Authored(ctx context.Context, sel ast.SelectionSet, return graphql.Null } return ec._AddCommentTimelineItem(ctx, sel, obj) - case bug.LabelChangeTimelineItem: - return ec._LabelChangeTimelineItem(ctx, sel, &obj) case *bug.LabelChangeTimelineItem: if obj == nil { return graphql.Null } return ec._LabelChangeTimelineItem(ctx, sel, obj) - case bug.SetStatusTimelineItem: - return ec._SetStatusTimelineItem(ctx, sel, &obj) case *bug.SetStatusTimelineItem: if obj == nil { return graphql.Null } return ec._SetStatusTimelineItem(ctx, sel, obj) - case bug.SetTitleTimelineItem: - return ec._SetTitleTimelineItem(ctx, sel, &obj) case *bug.SetTitleTimelineItem: if obj == nil { return graphql.Null @@ -588,6 +583,16 @@ func (ec *executionContext) marshalNColor2ᚖimageᚋcolorᚐRGBA(ctx context.Co return ec._Color(ctx, sel, v) } +func (ec *executionContext) unmarshalNCombinedId2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentityᚐCombinedId(ctx context.Context, v interface{}) (entity.CombinedId, error) { + var res entity.CombinedId + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNCombinedId2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋentityᚐCombinedId(ctx context.Context, sel ast.SelectionSet, v entity.CombinedId) graphql.Marshaler { + return v +} + func (ec *executionContext) unmarshalNHash2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋrepositoryᚐHash(ctx context.Context, v interface{}) (repository.Hash, error) { var res repository.Hash err := res.UnmarshalGQL(v) |