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

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

Instance Method Summary collapse

Instance Method Details

#pop(stack, node) ⇒ Object



40
41
42
# File 'lib/graph_ql/static_validation/type_stack.rb', line 40

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

#push(stack, node) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/graph_ql/static_validation/type_stack.rb', line 32

def push(stack, node)
  object_type = stack.schema.types[node.type]
  if !object_type.nil?
    object_type = object_type.kind.unwrap(object_type)
  end
  stack.object_types.push(object_type)
end