aboutsummaryrefslogtreecommitdiffstats
path: root/graphql/connections/gen_operation.go
diff options
context:
space:
mode:
Diffstat (limited to 'graphql/connections/gen_operation.go')
-rw-r--r--graphql/connections/gen_operation.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/graphql/connections/gen_operation.go b/graphql/connections/gen_operation.go
index 4d1015f5..9a1a53b7 100644
--- a/graphql/connections/gen_operation.go
+++ b/graphql/connections/gen_operation.go
@@ -28,6 +28,7 @@ func BugOperationCon(source []bug.Operation, edgeMaker BugOperationEdgeMaker, co
var edges []models.OperationEdge
var cursors []string
var pageInfo models.PageInfo
+ var totalCount = len(source)
emptyCon, _ := conMaker(edges, nodes, pageInfo, 0)
@@ -40,6 +41,7 @@ func BugOperationCon(source []bug.Operation, edgeMaker BugOperationEdgeMaker, co
// remove all previous element including the "after" one
source = source[i+1:]
offset = i + 1
+ pageInfo.HasPreviousPage = true
break
}
}
@@ -51,6 +53,7 @@ func BugOperationCon(source []bug.Operation, edgeMaker BugOperationEdgeMaker, co
if edge.GetCursor() == *input.Before {
// remove all after element including the "before" one
+ pageInfo.HasNextPage = true
break
}
@@ -104,5 +107,5 @@ func BugOperationCon(source []bug.Operation, edgeMaker BugOperationEdgeMaker, co
pageInfo.EndCursor = cursors[len(cursors)-1]
}
- return conMaker(edges, nodes, pageInfo, len(source))
+ return conMaker(edges, nodes, pageInfo, totalCount)
}