aboutsummaryrefslogtreecommitdiffstats
path: root/api/graphql/connections/gen_operation.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2022-07-25 13:16:16 +0200
committerMichael Muré <batolettre@gmail.com>2022-07-25 13:27:17 +0200
commit3d454d9dc8ba2409046c0938618a70864e6eb8ef (patch)
tree8745f656cc8218654632ce003f997a39988d3043 /api/graphql/connections/gen_operation.go
parent2ade8fb1d570ddcb4aedc9386af46d208b129daa (diff)
downloadgit-bug-3d454d9dc8ba2409046c0938618a70864e6eb8ef.tar.gz
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
Diffstat (limited to 'api/graphql/connections/gen_operation.go')
-rw-r--r--api/graphql/connections/gen_operation.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/api/graphql/connections/gen_operation.go b/api/graphql/connections/gen_operation.go
index 4bd84895..848cebd6 100644
--- a/api/graphql/connections/gen_operation.go
+++ b/api/graphql/connections/gen_operation.go
@@ -8,23 +8,23 @@ import (
"fmt"
"github.com/MichaelMure/git-bug/api/graphql/models"
- "github.com/MichaelMure/git-bug/bug"
+ "github.com/MichaelMure/git-bug/entity/dag"
)
-// BugOperationEdgeMaker define a function that take a bug.Operation and an offset and
+// DagOperationEdgeMaker define a function that take a dag.Operation and an offset and
// create an Edge.
-type OperationEdgeMaker func(value bug.Operation, offset int) Edge
+type OperationEdgeMaker func(value dag.Operation, offset int) Edge
// OperationConMaker define a function that create a models.OperationConnection
type OperationConMaker func(
edges []*models.OperationEdge,
- nodes []bug.Operation,
+ nodes []dag.Operation,
info *models.PageInfo,
totalCount int) (*models.OperationConnection, error)
// OperationCon will paginate a source according to the input of a relay connection
-func OperationCon(source []bug.Operation, edgeMaker OperationEdgeMaker, conMaker OperationConMaker, input models.ConnectionInput) (*models.OperationConnection, error) {
- var nodes []bug.Operation
+func OperationCon(source []dag.Operation, edgeMaker OperationEdgeMaker, conMaker OperationConMaker, input models.ConnectionInput) (*models.OperationConnection, error) {
+ var nodes []dag.Operation
var edges []*models.OperationEdge
var cursors []string
var pageInfo = &models.PageInfo{}