Module: GraphQL::StaticValidation::TypeStack::FragmentWithTypeStrategy

Included in:
FragmentDefinitionStrategy, InlineFragmentStrategy
Defined in:
lib/graphql/static_validation/type_stack.rb

Instance Method Summary collapse

Instance Method Details

#pop(stack, node) ⇒ Object



69
70
71
72
# File 'lib/graphql/static_validation/type_stack.rb', line 69

def pop(stack, node)
  stack.object_types.pop
  stack.path.pop
end

#push(stack, node) ⇒ Object



56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/graphql/static_validation/type_stack.rb', line 56

def push(stack, node)
  object_type = if node.type
    stack.schema.get_type(node.type.name)
  else
    stack.object_types.last
  end
  if !object_type.nil?
    object_type = object_type.unwrap
  end
  stack.object_types.push(object_type)
  push_path_member(stack, node)
end