Module: GraphQL::StaticValidation::OneOfInputObjectsAreValid

Defined in:
lib/graphql/static_validation/rules/one_of_input_objects_are_valid.rb

Instance Method Summary collapse

Instance Method Details

#on_input_object(node, parent) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/graphql/static_validation/rules/one_of_input_objects_are_valid.rb', line 5

def on_input_object(node, parent)
  return super unless parent.is_a?(GraphQL::Language::Nodes::Argument)

  parent_type = get_parent_type(context, parent)
  return super unless parent_type && parent_type.kind.input_object? && parent_type.one_of?

  validate_one_of_input_object(node, context, parent_type)
  super
end