Class: Types::NotificationsWithCountsConnection

Inherits:
GraphQL::Types::Relay::BaseConnection
  • Object
show all
Defined in:
app/graphql/types/notifications_with_counts_connection.rb

Instance Method Summary collapse

Instance Method Details

#total_countObject



7
8
9
10
11
# File 'app/graphql/types/notifications_with_counts_connection.rb', line 7

def total_count
  # - `object` is the Connection
  # - `object.items` is the original collection of Notifications
  object.items.size
end

#unread_countObject



14
15
16
# File 'app/graphql/types/notifications_with_counts_connection.rb', line 14

def unread_count
  object.items.unread.size
end