aboutsummaryrefslogtreecommitdiffstats
path: root/graphql/connections/connection_template.go
diff options
context:
space:
mode:
Diffstat (limited to 'graphql/connections/connection_template.go')
-rw-r--r--graphql/connections/connection_template.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/graphql/connections/connection_template.go b/graphql/connections/connection_template.go
index 3dfaca8f..7f97c00b 100644
--- a/graphql/connections/connection_template.go
+++ b/graphql/connections/connection_template.go
@@ -11,13 +11,13 @@ type EdgeType generic.Type
type ConnectionType generic.Type
type NodeTypeEdger func(value NodeType, offset int) Edge
-type NodeTypeConMaker func(edges []EdgeType, info models.PageInfo, totalCount int) ConnectionType
+type NodeTypeConMaker func(edges []EdgeType, info models.PageInfo, totalCount int) (ConnectionType, error)
func NodeTypeCon(source []NodeType, edger NodeTypeEdger, conMaker NodeTypeConMaker, input models.ConnectionInput) (ConnectionType, error) {
var edges []EdgeType
var pageInfo models.PageInfo
- emptyCon := conMaker(edges, pageInfo, 0)
+ emptyCon, _ := conMaker(edges, pageInfo, 0)
offset := 0
@@ -76,7 +76,5 @@ func NodeTypeCon(source []NodeType, edger NodeTypeEdger, conMaker NodeTypeConMak
}
}
- con := conMaker(edges, pageInfo, len(source))
-
- return con, nil
+ return conMaker(edges, pageInfo, len(source))
}