diff options
author | Michael Muré <michael.mure@consensys.net> | 2019-03-31 21:44:14 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2019-04-01 14:03:13 +0200 |
commit | 15c258cdc4ba37820362a44dfc2636ed1ff92b4c (patch) | |
tree | 0790e36bf4846b12b367f12670540eec6ee023f3 /graphql/connections/connection_template.go | |
parent | e028b895aa21553937d732044b7bb0a15c5276f6 (diff) | |
download | git-bug-15c258cdc4ba37820362a44dfc2636ed1ff92b4c.tar.gz |
graphql: expose allIdentities, identities and userIdentity in the repo
Diffstat (limited to 'graphql/connections/connection_template.go')
-rw-r--r-- | graphql/connections/connection_template.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/graphql/connections/connection_template.go b/graphql/connections/connection_template.go index e20375b8..e98f53eb 100644 --- a/graphql/connections/connection_template.go +++ b/graphql/connections/connection_template.go @@ -7,6 +7,9 @@ import ( "github.com/cheekybits/genny/generic" ) +// Name define the name of the connection +type Name generic.Type + // NodeType define the node type handled by this relay connection type NodeType generic.Type @@ -18,17 +21,17 @@ type ConnectionType generic.Type // NodeTypeEdgeMaker define a function that take a NodeType and an offset and // create an Edge. -type NodeTypeEdgeMaker func(value NodeType, offset int) Edge +type NameEdgeMaker func(value NodeType, offset int) Edge -// NodeTypeConMaker define a function that create a ConnectionType -type NodeTypeConMaker func( +// NameConMaker define a function that create a ConnectionType +type NameConMaker func( edges []EdgeType, nodes []NodeType, info models.PageInfo, totalCount int) (ConnectionType, error) -// NodeTypeCon will paginate a source according to the input of a relay connection -func NodeTypeCon(source []NodeType, edgeMaker NodeTypeEdgeMaker, conMaker NodeTypeConMaker, input models.ConnectionInput) (ConnectionType, error) { +// NameCon will paginate a source according to the input of a relay connection +func NameCon(source []NodeType, edgeMaker NameEdgeMaker, conMaker NameConMaker, input models.ConnectionInput) (ConnectionType, error) { var nodes []NodeType var edges []EdgeType var cursors []string |