From 3d454d9dc8ba2409046c0938618a70864e6eb8ef Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Mon, 25 Jul 2022 13:16:16 +0200 Subject: entity/dag: proper base operation for simplified implementation - reduce boilerplace necessary to implement an operation - consolidate what an operation is in the core, which in turn pave the way for a generic cache layer mechanism - avoid the previously complex unmarshalling process - support operation metadata from the core - simplified testing --- api/graphql/resolvers/bug.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'api/graphql/resolvers') diff --git a/api/graphql/resolvers/bug.go b/api/graphql/resolvers/bug.go index 815cba8d..18c8d7f4 100644 --- a/api/graphql/resolvers/bug.go +++ b/api/graphql/resolvers/bug.go @@ -7,6 +7,7 @@ import ( "github.com/MichaelMure/git-bug/api/graphql/graph" "github.com/MichaelMure/git-bug/api/graphql/models" "github.com/MichaelMure/git-bug/bug" + "github.com/MichaelMure/git-bug/entity/dag" ) var _ graph.BugResolver = &bugResolver{} @@ -69,14 +70,14 @@ func (bugResolver) Operations(_ context.Context, obj models.BugWrapper, after *s Last: last, } - edger := func(op bug.Operation, offset int) connections.Edge { + edger := func(op dag.Operation, offset int) connections.Edge { return models.OperationEdge{ Node: op, Cursor: connections.OffsetToCursor(offset), } } - conMaker := func(edges []*models.OperationEdge, nodes []bug.Operation, info *models.PageInfo, totalCount int) (*models.OperationConnection, error) { + conMaker := func(edges []*models.OperationEdge, nodes []dag.Operation, info *models.PageInfo, totalCount int) (*models.OperationConnection, error) { return &models.OperationConnection{ Edges: edges, Nodes: nodes, -- cgit