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



71
72
73
74
# File 'lib/graphql/static_validation/type_stack.rb', line 71

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

#push(stack, node) ⇒ Object



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

def push(stack, node)
  object_type = if node.type
    stack.schema.types.fetch(node.type, nil)
  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