class GraphQL::Schema::NonNull

@see {Schema::Member::TypeSystemHelpers#to_non_null_type}
Wraps a {Schema::Member} when it is required.
Represents a non null type in the schema.

def coerce_input(value, ctx)

def coerce_input(value, ctx)
  # `.validate_input` above is used for variables, but this method is used for arguments
  if value.nil?
    raise GraphQL::ExecutionError, "`null` is not a valid input for `#{to_type_signature}`, please provide a value for this argument."
  end
  of_type.coerce_input(value, ctx)
end

def coerce_result(value, ctx)

def coerce_result(value, ctx)
  of_type.coerce_result(value, ctx)
end

def description

This is for implementing introspection
def description
  nil
end

def graphql_name

This is for introspection, where it's expected the name will be `null`
def graphql_name
  nil
end

def inspect

def inspect
  "#<#{self.class.name} @of_type=#{@of_type.inspect}>"
end

def kind

Returns:
  • (GraphQL::TypeKinds::NON_NULL) -
def kind
  GraphQL::TypeKinds::NON_NULL
end

def list?

Returns:
  • (Boolean) - True if this type wraps a list type
def list?
  @of_type.list?
end

def non_null?

Returns:
  • (true) -
def non_null?
  true
end

def to_type_signature

def to_type_signature
  "#{@of_type.to_type_signature}!"
end

def validate_input(value, ctx, max_errors: nil)

def validate_input(value, ctx, max_errors: nil)
  if value.nil?
    result = GraphQL::Query::InputValidationResult.new
    result.add_problem("Expected value to not be null")
    result
  else
    of_type.validate_input(value, ctx, max_errors: max_errors)
  end
end