Method: GraphQL::Schema::Validator#permitted_empty_value?

Defined in:
lib/graphql/schema/validator.rb

#permitted_empty_value?(value) ⇒ Boolean

Returns true if value is nil and this validator has allow_null: true or if value is .blank? and this validator has allow_blank: true.

Returns:

  • (Boolean)

    true if value is nil and this validator has allow_null: true or if value is .blank? and this validator has allow_blank: true



38
39
40
41
# File 'lib/graphql/schema/validator.rb', line 38

def permitted_empty_value?(value)
  (value.nil? && @allow_null) ||
    (@allow_blank && value.respond_to?(:blank?) && value.blank?)
end