aboutsummaryrefslogtreecommitdiffstats
path: root/graphql/connections/gen_timeline.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-05-15 18:20:54 +0200
committerGitHub <noreply@github.com>2019-05-15 18:20:54 +0200
commit22f435bd2a8fc35bde96eafb50b3f78650a5983b (patch)
tree629b72f3d95ac7b7806fb83096a3b89e14f745ef /graphql/connections/gen_timeline.go
parent97476ff5fadaf0a457d0f0133db58415b6075940 (diff)
parent8bab279114f06f10e22435b0caf9002201831555 (diff)
downloadgit-bug-22f435bd2a8fc35bde96eafb50b3f78650a5983b.tar.gz
Merge pull request #134 from A-Hilaly/gqlgen
Upgrade gqlgen version to v0.9.0
Diffstat (limited to 'graphql/connections/gen_timeline.go')
-rw-r--r--graphql/connections/gen_timeline.go16
1 files changed, 9 insertions, 7 deletions
diff --git a/graphql/connections/gen_timeline.go b/graphql/connections/gen_timeline.go
index ad3fbf5b..01dac96b 100644
--- a/graphql/connections/gen_timeline.go
+++ b/graphql/connections/gen_timeline.go
@@ -17,17 +17,17 @@ type TimelineItemEdgeMaker func(value bug.TimelineItem, offset int) Edge
// TimelineItemConMaker define a function that create a models.TimelineItemConnection
type TimelineItemConMaker func(
- edges []models.TimelineItemEdge,
+ edges []*models.TimelineItemEdge,
nodes []bug.TimelineItem,
- info models.PageInfo,
+ info *models.PageInfo,
totalCount int) (*models.TimelineItemConnection, error)
// TimelineItemCon will paginate a source according to the input of a relay connection
func TimelineItemCon(source []bug.TimelineItem, edgeMaker TimelineItemEdgeMaker, conMaker TimelineItemConMaker, input models.ConnectionInput) (*models.TimelineItemConnection, error) {
var nodes []bug.TimelineItem
- var edges []models.TimelineItemEdge
+ var edges []*models.TimelineItemEdge
var cursors []string
- var pageInfo models.PageInfo
+ var pageInfo = &models.PageInfo{}
var totalCount = len(source)
emptyCon, _ := conMaker(edges, nodes, pageInfo, 0)
@@ -57,18 +57,20 @@ func TimelineItemCon(source []bug.TimelineItem, edgeMaker TimelineItemEdgeMaker,
break
}
- edges = append(edges, edge.(models.TimelineItemEdge))
+ e := edge.(models.TimelineItemEdge)
+ edges = append(edges, &e)
cursors = append(cursors, edge.GetCursor())
nodes = append(nodes, value)
}
} else {
- edges = make([]models.TimelineItemEdge, len(source))
+ edges = make([]*models.TimelineItemEdge, len(source))
cursors = make([]string, len(source))
nodes = source
for i, value := range source {
edge := edgeMaker(value, i+offset)
- edges[i] = edge.(models.TimelineItemEdge)
+ e := edge.(models.TimelineItemEdge)
+ edges[i] = &e
cursors[i] = edge.GetCursor()
}
}