Commit 0e825e45 authored by charlie ablett's avatar charlie ablett

Use Offset rather than Keyset pagination

parent cc1dcae0
...@@ -9,7 +9,7 @@ module Resolvers ...@@ -9,7 +9,7 @@ module Resolvers
def resolve(**args) def resolve(**args)
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
service = Boards::Issues::ListService.new(list.board.resource_parent, context[:current_user], { board_id: list.board.id, id: list.id }) service = Boards::Issues::ListService.new(list.board.resource_parent, context[:current_user], { board_id: list.board.id, id: list.id })
service.execute.reorder("issues.relative_position ASC").order("issues.id DESC") Gitlab::Graphql::Pagination::OffsetActiveRecordRelationConnection.new(service.execute)
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
end end
end end
......
...@@ -7,7 +7,7 @@ module Types ...@@ -7,7 +7,7 @@ module Types
description: 'Total count of collection' description: 'Total count of collection'
def count def count
relation = object.items relation = object.items.reorder(nil)
if relation.try(:group_values)&.present? if relation.try(:group_values)&.present?
relation.size.keys.size relation.size.keys.size
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment