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.
168 169 170 171 |
# File 'lib/graphql/pagination/connection.rb', line 168 def initialize(item, connection) @connection = connection @item = item end |
Instance Method Details
#cursor ⇒ Object
177 178 179 |
# File 'lib/graphql/pagination/connection.rb', line 177 def cursor @connection.cursor_for(@item) end |
#node ⇒ Object
173 174 175 |
# File 'lib/graphql/pagination/connection.rb', line 173 def node @item end |