From 8bab279114f06f10e22435b0caf9002201831555 Mon Sep 17 00:00:00 2001 From: Amine Hilaly Date: Wed, 15 May 2019 16:57:30 +0200 Subject: Update graphql package to support gqlgen 0.9.0 --- graphql/connections/gen_lazy_bug.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'graphql/connections/gen_lazy_bug.go') diff --git a/graphql/connections/gen_lazy_bug.go b/graphql/connections/gen_lazy_bug.go index e9da5cc7..6c9eb012 100644 --- a/graphql/connections/gen_lazy_bug.go +++ b/graphql/connections/gen_lazy_bug.go @@ -16,17 +16,17 @@ type LazyBugEdgeMaker func(value string, offset int) Edge // LazyBugConMaker define a function that create a models.BugConnection type LazyBugConMaker func( - edges []LazyBugEdge, + edges []*LazyBugEdge, nodes []string, - info models.PageInfo, + info *models.PageInfo, totalCount int) (*models.BugConnection, error) // LazyBugCon will paginate a source according to the input of a relay connection func LazyBugCon(source []string, edgeMaker LazyBugEdgeMaker, conMaker LazyBugConMaker, input models.ConnectionInput) (*models.BugConnection, error) { var nodes []string - var edges []LazyBugEdge + var edges []*LazyBugEdge var cursors []string - var pageInfo models.PageInfo + var pageInfo = &models.PageInfo{} var totalCount = len(source) emptyCon, _ := conMaker(edges, nodes, pageInfo, 0) @@ -56,18 +56,20 @@ func LazyBugCon(source []string, edgeMaker LazyBugEdgeMaker, conMaker LazyBugCon break } - edges = append(edges, edge.(LazyBugEdge)) + e := edge.(LazyBugEdge) + edges = append(edges, &e) cursors = append(cursors, edge.GetCursor()) nodes = append(nodes, value) } } else { - edges = make([]LazyBugEdge, len(source)) + edges = make([]*LazyBugEdge, len(source)) cursors = make([]string, len(source)) nodes = source for i, value := range source { edge := edgeMaker(value, i+offset) - edges[i] = edge.(LazyBugEdge) + e := edge.(LazyBugEdge) + edges[i] = &e cursors[i] = edge.GetCursor() } } -- cgit