Module: GraphQL::Schema::Member::ValidatesInput Private

Included in:
Enum, InputObject, List, NonNull, Scalar
Defined in:
lib/graphql/schema/member/validates_input.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#coerce_isolated_input(v) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


23
24
25
# File 'lib/graphql/schema/member/validates_input.rb', line 23

def coerce_isolated_input(v)
  coerce_input(v, GraphQL::Query::NullContext)
end

#coerce_isolated_result(v) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


27
28
29
# File 'lib/graphql/schema/member/validates_input.rb', line 27

def coerce_isolated_result(v)
  coerce_result(v, GraphQL::Query::NullContext)
end

#valid_input?(val, ctx) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:


7
8
9
# File 'lib/graphql/schema/member/validates_input.rb', line 7

def valid_input?(val, ctx)
  validate_input(val, ctx).valid?
end

#valid_isolated_input?(v) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:


19
20
21
# File 'lib/graphql/schema/member/validates_input.rb', line 19

def valid_isolated_input?(v)
  valid_input?(v, GraphQL::Query::NullContext)
end

#validate_input(val, ctx) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


11
12
13
14
15
16
17
# File 'lib/graphql/schema/member/validates_input.rb', line 11

def validate_input(val, ctx)
  if val.nil?
    GraphQL::Query::InputValidationResult.new
  else
    validate_non_null_input(val, ctx)
  end
end