Module: GraphQL::Types::Relay::ConnectionBehaviors
- Extended by:
- Forwardable
- Included in:
- BaseConnection
- Defined in:
- lib/graphql/types/relay/connection_behaviors.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
-
#edges ⇒ Object
-
#nodes ⇒ Object
By default this calls through to the ConnectionWrapper’s edge nodes method, but sometimes you need to override it to support the
nodes
field.
Class Method Details
Instance Method Details
#edges ⇒ Object
159 160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/graphql/types/relay/connection_behaviors.rb', line 159 def edges if @object.is_a?(GraphQL::Pagination::Connection) @object.edges elsif context.interpreter? context.schema.after_lazy(object.edge_nodes) do |nodes| nodes.map { |n| self.class.edge_class.new(n, object) } end else # This is done by edges_instrumentation @object.edge_nodes end end |
#nodes ⇒ Object
By default this calls through to the ConnectionWrapper’s edge nodes method,
but sometimes you need to override it to support the nodes
field
155 156 157 |
# File 'lib/graphql/types/relay/connection_behaviors.rb', line 155 def nodes @object.edge_nodes end |