Class: GraphQL::StaticValidation::TypeStack::FragmentWithTypeStrategy

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/static_validation/type_stack.rb

Instance Method Summary collapse

Instance Method Details

#pop(stack, node) ⇒ Object



73
74
75
76
# File 'lib/graphql/static_validation/type_stack.rb', line 73

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

#push(stack, node) ⇒ Object



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

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