Class: GraphQL::Pagination::MongoidRelationConnection
- Inherits:
-
Pagination::RelationConnection
- Object
- Pagination::RelationConnection
- GraphQL::Pagination::MongoidRelationConnection
- Defined in:
- lib/graphql/pagination/mongoid_relation_connection.rb
Instance Method Summary collapse
-
#null_relation(relation) ⇒ Object
: (untyped relation) -> untyped.
-
#relation_count(relation) ⇒ Object
: (untyped relation) -> Integer.
-
#relation_limit(relation) ⇒ Object
: (untyped relation) -> Integer?.
-
#relation_offset(relation) ⇒ Object
: (untyped relation) -> Integer?.
Instance Method Details
#null_relation(relation) ⇒ Object
: (untyped relation) -> untyped
25 26 27 |
# File 'lib/graphql/pagination/mongoid_relation_connection.rb', line 25 def null_relation(relation) relation..none end |
#relation_count(relation) ⇒ Object
: (untyped relation) -> Integer
20 21 22 |
# File 'lib/graphql/pagination/mongoid_relation_connection.rb', line 20 def relation_count(relation) relation.all.count(relation..slice(:limit, :skip)) end |
#relation_limit(relation) ⇒ Object
: (untyped relation) -> Integer?
15 16 17 |
# File 'lib/graphql/pagination/mongoid_relation_connection.rb', line 15 def relation_limit(relation) relation..limit end |
#relation_offset(relation) ⇒ Object
: (untyped relation) -> Integer?
10 11 12 |
# File 'lib/graphql/pagination/mongoid_relation_connection.rb', line 10 def relation_offset(relation) relation..skip end |