Class: GraphQL::Relay::Edge
- Inherits:
-
ObjectType
- Object
- ObjectType
- GraphQL::Relay::Edge
- Defined in:
- lib/graphql/relay/edge.rb
Overview
Mostly an internal concern.
Wraps an object as a ‘node`, and exposes a connection-specific `cursor`.
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#node ⇒ Object
readonly
Returns the value of attribute node.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
- #cursor ⇒ Object
-
#initialize(node, connection) ⇒ Edge
constructor
A new instance of Edge.
Constructor Details
#initialize(node, connection) ⇒ Edge
Returns a new instance of Edge.
8 9 10 11 12 |
# File 'lib/graphql/relay/edge.rb', line 8 def initialize(node, connection) @node = node @connection = connection @parent = parent end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
7 8 9 |
# File 'lib/graphql/relay/edge.rb', line 7 def connection @connection end |
#node ⇒ Object (readonly)
Returns the value of attribute node.
7 8 9 |
# File 'lib/graphql/relay/edge.rb', line 7 def node @node end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
7 8 9 |
# File 'lib/graphql/relay/edge.rb', line 7 def parent @parent end |
Instance Method Details
#cursor ⇒ Object
14 15 16 |
# File 'lib/graphql/relay/edge.rb', line 14 def cursor @cursor ||= connection.cursor_from_node(node) end |