aboutsummaryrefslogtreecommitdiffstats
path: root/graphql/connections/gen_lazy_identity.go
diff options
context:
space:
mode:
authorAmine <hilalyamine@gmail.com>2019-08-13 16:47:24 +0200
committerGitHub <noreply@github.com>2019-08-13 16:47:24 +0200
commitcf960bc7a5bd0b7af28d35de33131fb0b5ce5253 (patch)
tree5df133c91bb4e1ccc5f9fbeb4664416b93d23bf5 /graphql/connections/gen_lazy_identity.go
parent146894a5657d3b20dbaf769a950b12bd19df499c (diff)
parentc809d37152ea87a66fc281730042dcb4299a8263 (diff)
downloadgit-bug-cf960bc7a5bd0b7af28d35de33131fb0b5ce5253.tar.gz
Merge pull request #193 from MichaelMure/immutableID
Future proof the operation's ID
Diffstat (limited to 'graphql/connections/gen_lazy_identity.go')
-rw-r--r--graphql/connections/gen_lazy_identity.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/graphql/connections/gen_lazy_identity.go b/graphql/connections/gen_lazy_identity.go
index 96461be5..932d802c 100644
--- a/graphql/connections/gen_lazy_identity.go
+++ b/graphql/connections/gen_lazy_identity.go
@@ -7,23 +7,24 @@ package connections
import (
"fmt"
+ "github.com/MichaelMure/git-bug/entity"
"github.com/MichaelMure/git-bug/graphql/models"
)
-// StringEdgeMaker define a function that take a string and an offset and
+// EntityIdEdgeMaker define a function that take a entity.Id and an offset and
// create an Edge.
-type LazyIdentityEdgeMaker func(value string, offset int) Edge
+type LazyIdentityEdgeMaker func(value entity.Id, offset int) Edge
// LazyIdentityConMaker define a function that create a models.IdentityConnection
type LazyIdentityConMaker func(
edges []*LazyIdentityEdge,
- nodes []string,
+ nodes []entity.Id,
info *models.PageInfo,
totalCount int) (*models.IdentityConnection, error)
// LazyIdentityCon will paginate a source according to the input of a relay connection
-func LazyIdentityCon(source []string, edgeMaker LazyIdentityEdgeMaker, conMaker LazyIdentityConMaker, input models.ConnectionInput) (*models.IdentityConnection, error) {
- var nodes []string
+func LazyIdentityCon(source []entity.Id, edgeMaker LazyIdentityEdgeMaker, conMaker LazyIdentityConMaker, input models.ConnectionInput) (*models.IdentityConnection, error) {
+ var nodes []entity.Id
var edges []*LazyIdentityEdge
var cursors []string
var pageInfo = &models.PageInfo{}