module GraphQL::Types::Relay::EdgeBehaviors::ClassMethods

def accessible?(ctx)

def accessible?(ctx)
  node_type.accessible?(ctx)
end

def authorized?(obj, ctx)

def authorized?(obj, ctx)
  true
end

def node_nullable(new_value = nil)

Use `node_nullable(false)` in your base class to make non-null `node` field.
Set the default `node_nullable` for this class and its child classes. (Defaults to `true`.)
def node_nullable(new_value = nil)
  if new_value.nil?
    defined?(@node_nullable) ? @node_nullable : superclass.node_nullable
  else
    @node_nullable = new_value
  end
end

def node_type(node_type = nil, null: self.node_nullable, field_options: nil)

Parameters:
  • field_options (Hash) -- Any extra arguments to pass to the `field :node` configuration
  • null (Boolean) --
  • node_type (Class) -- A `Schema::Object` subclass
def node_type(node_type = nil, null: self.node_nullable, field_options: nil)
  if node_type
    @node_type = node_type
    # Add a default `node` field
    base_field_options = {
      name: :node,
      type: node_type,
      null: null,
      description: "The item at the end of the edge.",
      connection: false,
    }
    if field_options
      base_field_options.merge!(field_options)
    end
    field(**base_field_options)
  end
  @node_type
end

def visible?(ctx)

def visible?(ctx)
  node_type.visible?(ctx)
end