diff options
Diffstat (limited to 'api/graphql/resolvers')
-rw-r--r-- | api/graphql/resolvers/bug.go | 10 | ||||
-rw-r--r-- | api/graphql/resolvers/label.go | 6 | ||||
-rw-r--r-- | api/graphql/resolvers/repo.go | 12 |
3 files changed, 14 insertions, 14 deletions
diff --git a/api/graphql/resolvers/bug.go b/api/graphql/resolvers/bug.go index d5c13e06..c984e191 100644 --- a/api/graphql/resolvers/bug.go +++ b/api/graphql/resolvers/bug.go @@ -51,7 +51,7 @@ func (bugResolver) Comments(_ context.Context, obj models.BugWrapper, after *str return nil, err } - return connections.CommentCon(comments, edger, conMaker, input) + return connections.Connection(comments, edger, conMaker, input) } func (bugResolver) Operations(_ context.Context, obj models.BugWrapper, after *string, before *string, first *int, last *int) (*models.OperationConnection, error) { @@ -83,7 +83,7 @@ func (bugResolver) Operations(_ context.Context, obj models.BugWrapper, after *s return nil, err } - return connections.OperationCon(ops, edger, conMaker, input) + return connections.Connection(ops, edger, conMaker, input) } func (bugResolver) Timeline(_ context.Context, obj models.BugWrapper, after *string, before *string, first *int, last *int) (*models.TimelineItemConnection, error) { @@ -115,7 +115,7 @@ func (bugResolver) Timeline(_ context.Context, obj models.BugWrapper, after *str return nil, err } - return connections.TimelineItemCon(timeline, edger, conMaker, input) + return connections.Connection(timeline, edger, conMaker, input) } func (bugResolver) Actors(_ context.Context, obj models.BugWrapper, after *string, before *string, first *int, last *int) (*models.IdentityConnection, error) { @@ -147,7 +147,7 @@ func (bugResolver) Actors(_ context.Context, obj models.BugWrapper, after *strin return nil, err } - return connections.IdentityCon(actors, edger, conMaker, input) + return connections.Connection(actors, edger, conMaker, input) } func (bugResolver) Participants(_ context.Context, obj models.BugWrapper, after *string, before *string, first *int, last *int) (*models.IdentityConnection, error) { @@ -179,5 +179,5 @@ func (bugResolver) Participants(_ context.Context, obj models.BugWrapper, after return nil, err } - return connections.IdentityCon(participants, edger, conMaker, input) + return connections.Connection(participants, edger, conMaker, input) } diff --git a/api/graphql/resolvers/label.go b/api/graphql/resolvers/label.go index 8fe6c8e5..3e63b655 100644 --- a/api/graphql/resolvers/label.go +++ b/api/graphql/resolvers/label.go @@ -5,18 +5,18 @@ import ( "image/color" "github.com/git-bug/git-bug/api/graphql/graph" - "github.com/git-bug/git-bug/entities/bug" + "github.com/git-bug/git-bug/entities/common" ) var _ graph.LabelResolver = &labelResolver{} type labelResolver struct{} -func (labelResolver) Name(ctx context.Context, obj *bug.Label) (string, error) { +func (labelResolver) Name(ctx context.Context, obj *common.Label) (string, error) { return obj.String(), nil } -func (labelResolver) Color(ctx context.Context, obj *bug.Label) (*color.RGBA, error) { +func (labelResolver) Color(ctx context.Context, obj *common.Label) (*color.RGBA, error) { rgba := obj.Color().RGBA() return &rgba, nil } diff --git a/api/graphql/resolvers/repo.go b/api/graphql/resolvers/repo.go index bfec95fb..45dc7110 100644 --- a/api/graphql/resolvers/repo.go +++ b/api/graphql/resolvers/repo.go @@ -7,7 +7,7 @@ import ( "github.com/git-bug/git-bug/api/graphql/connections" "github.com/git-bug/git-bug/api/graphql/graph" "github.com/git-bug/git-bug/api/graphql/models" - "github.com/git-bug/git-bug/entities/bug" + "github.com/git-bug/git-bug/entities/common" "github.com/git-bug/git-bug/entity" "github.com/git-bug/git-bug/query" ) @@ -82,7 +82,7 @@ func (repoResolver) AllBugs(_ context.Context, obj *models.Repository, after *st }, nil } - return connections.LazyBugCon(source, edger, conMaker, input) + return connections.Connection(source, edger, conMaker, input) } func (repoResolver) Bug(_ context.Context, obj *models.Repository, prefix string) (models.BugWrapper, error) { @@ -141,7 +141,7 @@ func (repoResolver) AllIdentities(_ context.Context, obj *models.Repository, aft }, nil } - return connections.LazyIdentityCon(source, edger, conMaker, input) + return connections.Connection(source, edger, conMaker, input) } func (repoResolver) Identity(_ context.Context, obj *models.Repository, prefix string) (models.IdentityWrapper, error) { @@ -171,14 +171,14 @@ func (repoResolver) ValidLabels(_ context.Context, obj *models.Repository, after Last: last, } - edger := func(label bug.Label, offset int) connections.Edge { + edger := func(label common.Label, offset int) connections.Edge { return models.LabelEdge{ Node: label, Cursor: connections.OffsetToCursor(offset), } } - conMaker := func(edges []*models.LabelEdge, nodes []bug.Label, info *models.PageInfo, totalCount int) (*models.LabelConnection, error) { + conMaker := func(edges []*models.LabelEdge, nodes []common.Label, info *models.PageInfo, totalCount int) (*models.LabelConnection, error) { return &models.LabelConnection{ Edges: edges, Nodes: nodes, @@ -187,5 +187,5 @@ func (repoResolver) ValidLabels(_ context.Context, obj *models.Repository, after }, nil } - return connections.LabelCon(obj.Repo.Bugs().ValidLabels(), edger, conMaker, input) + return connections.Connection(obj.Repo.Bugs().ValidLabels(), edger, conMaker, input) } |