Method: GraphQL::Types::Relay::ConnectionBehaviors::ClassMethods#has_nodes_field

Defined in:
lib/graphql/types/relay/connection_behaviors.rb

#has_nodes_field(new_value = nil) ⇒ Object

Set the default nodes_field for this class and its child classes. (Defaults to true.) Use nodes_field(false) in your base class to prevent adding of a nodes field.



159
160
161
162
163
164
165
# File 'lib/graphql/types/relay/connection_behaviors.rb', line 159

def has_nodes_field(new_value = nil)
  if new_value.nil?
    defined?(@nodes_field) ? @nodes_field : superclass.has_nodes_field
  else
    @nodes_field = new_value
  end
end