Class: Types::CountableConnectionType
- Inherits:
-
GraphQL::Types::Relay::BaseConnection
- Object
- GraphQL::Types::Relay::BaseConnection
- Types::CountableConnectionType
- Defined in:
- app/graphql/types/countable_connection_type.rb
Overview
rubocop: disable Graphql/AuthorizeTypes
Direct Known Subclasses
Types::Ci::RunnerCountableConnectionType, IssueConnectionType, MergeRequestConnectionType, TimeTracking::TimelogConnectionType
Instance Method Summary collapse
Instance Method Details
#count ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/graphql/types/countable_connection_type.rb', line 9 def count # rubocop: disable CodeReuse/ActiveRecord relation = object.items # sometimes relation is an Array relation = relation.reorder(nil) if relation.respond_to?(:reorder) # rubocop: enable CodeReuse/ActiveRecord if relation.try(:group_values).present? relation.size.keys.size else relation.size end end |