lib/rails/graphql/helpers/with_validator.rb
def validate_output!(value, type, checker: :null?, array: true)
            result = validate_null(value, checker)
            result ||= array? && array \
              ? validate_array(value) \
              : validate_type(value) \
              unless value.nil?

            return if result.blank?
            message, idx = result

            base_error = idx.present? \
              ? "#{ordinalize(idx + 1)} value of the #{gql_name} #{type}" \
              : "#{gql_name} #{type} value"

            raise InvalidValueError, "The #{base_error} #{message}."
          end
# Run the validation process with +value+ against +type+
Run the validation process with +value+ against +type+
Run the validation process with + value + against + type +
def validate_output!(value, type, checker: :null?, array: true)
            result = validate_null(value, checker)
            result ||= array? && array \
              ? validate_array(value) \
              : validate_type(value) \
              unless value.nil?
            return if result.blank?
            message, idx = result
            base_error = idx.present? \
              ? "#{ordinalize(idx + 1)} value of the #{gql_name} #{type}" \
              : "#{gql_name} #{type} value"
            raise InvalidValueError, "The #{base_error} #{message}."
          end
def validate_output! ( value , type , checker : :null? , array : true ) result = validate_null ( value , checker ) result ||= array? && array ? validate_array ( value ) : validate_type ( value ) unless value . nil? return if result . blank? message , idx = result base_error = idx . present? ? "#{ordinalize(idx + 1)} value of the #{gql_name} #{type}" : "#{gql_name} #{type} value" raise InvalidValueError , "The #{base_error} #{message}." end
Run the validation process with +value+ against +type+
Run the validation process with + value + against + type +
value
type
checker
array