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
-
#was_authorized_by_scope_items? ⇒ Boolean
Constructor Details
#initialize(node, connection) ⇒ Edge
Returns a new instance of Edge.
256 257 258 259 |
# File 'lib/graphql/pagination/connection.rb', line 256 def initialize(node, connection) @connection = connection @node = node end |
Instance Attribute Details
#node ⇒ Object (readonly)
Returns the value of attribute node.
254 255 256 |
# File 'lib/graphql/pagination/connection.rb', line 254 def node @node end |
Instance Method Details
#cursor ⇒ Object
265 266 267 |
# File 'lib/graphql/pagination/connection.rb', line 265 def cursor @cursor ||= @connection.cursor_for(@node) end |
#parent ⇒ Object
261 262 263 |
# File 'lib/graphql/pagination/connection.rb', line 261 def parent @connection.parent end |
#was_authorized_by_scope_items? ⇒ Boolean
269 270 271 |
# File 'lib/graphql/pagination/connection.rb', line 269 def @connection. end |