class GraphQL::Client::Schema::ListType

def cast(values, errors)

Returns List instance or nil.

errors - Errors instance
values - JSON value

Internal: Cast JSON value to wrapped value.
def cast(values, errors)
  case values
  when Array
    List.new(values.each_with_index.map { |e, idx|
      of_klass.cast(e, errors.filter_by_path(idx))
    }, errors)
  when NilClass
    nil
  else
    raise InvariantError, "expected value to be a list, but was #{values.class}"
  end
end

def initialize(of_klass)

of_klass - BaseType instance

Internal: Construct list wrapper from other BaseType.
def initialize(of_klass)
  unless of_klass.is_a?(BaseType)
    raise TypeError, "expected #{of_klass.inspect} to be a #{BaseType}"
  end
  @of_klass = of_klass
end

def to_list_type

Returns ListType instance.

Internal: Get list wrapper of this type class.
def to_list_type
  self
end