Class: GraphQL::Pagination::Connection::Edge
- Inherits:
-
Object
- Object
- GraphQL::Pagination::Connection::Edge
- Defined in:
- lib/graphql/pagination/connection.rb
Overview
A wrapper around paginated items. It includes a #cursor for pagination and could be extended with custom relationship-level data.
Instance Attribute Summary collapse
-
#node ⇒ Object
readonly
Returns the value of attribute node.
Instance Method Summary collapse
- #cursor ⇒ Object
-
#initialize(node, connection) ⇒ Edge
constructor
A new instance of Edge.
- #parent ⇒ Object
Constructor Details
#initialize(node, connection) ⇒ Edge
Returns a new instance of Edge.
238 239 240 241 |
# File 'lib/graphql/pagination/connection.rb', line 238 def initialize(node, connection) @connection = connection @node = node end |
Instance Attribute Details
#node ⇒ Object (readonly)
Returns the value of attribute node.
236 237 238 |
# File 'lib/graphql/pagination/connection.rb', line 236 def node @node end |
Instance Method Details
#cursor ⇒ Object
247 248 249 |
# File 'lib/graphql/pagination/connection.rb', line 247 def cursor @cursor ||= @connection.cursor_for(@node) end |
#parent ⇒ Object
243 244 245 |
# File 'lib/graphql/pagination/connection.rb', line 243 def parent @connection.parent end |