diff options
author | Michael Muré <batolettre@gmail.com> | 2019-05-15 18:20:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-15 18:20:54 +0200 |
commit | 22f435bd2a8fc35bde96eafb50b3f78650a5983b (patch) | |
tree | 629b72f3d95ac7b7806fb83096a3b89e14f745ef /graphql/resolvers/bug.go | |
parent | 97476ff5fadaf0a457d0f0133db58415b6075940 (diff) | |
parent | 8bab279114f06f10e22435b0caf9002201831555 (diff) | |
download | git-bug-22f435bd2a8fc35bde96eafb50b3f78650a5983b.tar.gz |
Merge pull request #134 from A-Hilaly/gqlgen
Upgrade gqlgen version to v0.9.0
Diffstat (limited to 'graphql/resolvers/bug.go')
-rw-r--r-- | graphql/resolvers/bug.go | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/graphql/resolvers/bug.go b/graphql/resolvers/bug.go index 2ad2310b..37766b95 100644 --- a/graphql/resolvers/bug.go +++ b/graphql/resolvers/bug.go @@ -29,15 +29,19 @@ func (bugResolver) Comments(ctx context.Context, obj *bug.Snapshot, after *strin edger := func(comment bug.Comment, offset int) connections.Edge { return models.CommentEdge{ - Node: comment, + Node: &comment, Cursor: connections.OffsetToCursor(offset), } } - conMaker := func(edges []models.CommentEdge, nodes []bug.Comment, info models.PageInfo, totalCount int) (*models.CommentConnection, error) { + conMaker := func(edges []*models.CommentEdge, nodes []bug.Comment, info *models.PageInfo, totalCount int) (*models.CommentConnection, error) { + var commentNodes []*bug.Comment + for _, c := range nodes { + commentNodes = append(commentNodes, &c) + } return &models.CommentConnection{ Edges: edges, - Nodes: nodes, + Nodes: commentNodes, PageInfo: info, TotalCount: totalCount, }, nil @@ -61,7 +65,7 @@ func (bugResolver) Operations(ctx context.Context, obj *bug.Snapshot, after *str } } - conMaker := func(edges []models.OperationEdge, nodes []bug.Operation, info models.PageInfo, totalCount int) (*models.OperationConnection, error) { + conMaker := func(edges []*models.OperationEdge, nodes []bug.Operation, info *models.PageInfo, totalCount int) (*models.OperationConnection, error) { return &models.OperationConnection{ Edges: edges, Nodes: nodes, @@ -88,7 +92,7 @@ func (bugResolver) Timeline(ctx context.Context, obj *bug.Snapshot, after *strin } } - conMaker := func(edges []models.TimelineItemEdge, nodes []bug.TimelineItem, info models.PageInfo, totalCount int) (*models.TimelineItemConnection, error) { + conMaker := func(edges []*models.TimelineItemEdge, nodes []bug.TimelineItem, info *models.PageInfo, totalCount int) (*models.TimelineItemConnection, error) { return &models.TimelineItemConnection{ Edges: edges, Nodes: nodes, @@ -120,7 +124,7 @@ func (bugResolver) Actors(ctx context.Context, obj *bug.Snapshot, after *string, } } - conMaker := func(edges []models.IdentityEdge, nodes []identity.Interface, info models.PageInfo, totalCount int) (*models.IdentityConnection, error) { + conMaker := func(edges []*models.IdentityEdge, nodes []identity.Interface, info *models.PageInfo, totalCount int) (*models.IdentityConnection, error) { return &models.IdentityConnection{ Edges: edges, Nodes: nodes, @@ -147,7 +151,7 @@ func (bugResolver) Participants(ctx context.Context, obj *bug.Snapshot, after *s } } - conMaker := func(edges []models.IdentityEdge, nodes []identity.Interface, info models.PageInfo, totalCount int) (*models.IdentityConnection, error) { + conMaker := func(edges []*models.IdentityEdge, nodes []identity.Interface, info *models.PageInfo, totalCount int) (*models.IdentityConnection, error) { return &models.IdentityConnection{ Edges: edges, Nodes: nodes, |