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 Method Summary collapse
-
#cursor ⇒ Object
-
#initialize(item, connection) ⇒ Edge
constructor
A new instance of Edge.
-
#node ⇒ Object
Constructor Details
#initialize(item, connection) ⇒ Edge
Returns a new instance of Edge.
156 157 158 159 |
# File 'lib/graphql/pagination/connection.rb', line 156 def initialize(item, connection) @connection = connection @item = item end |
Instance Method Details
#cursor ⇒ Object
165 166 167 |
# File 'lib/graphql/pagination/connection.rb', line 165 def cursor @connection.cursor_for(@item) end |
#node ⇒ Object
161 162 163 |
# File 'lib/graphql/pagination/connection.rb', line 161 def node @item end |