Class: GraphQL::StaticValidation::TypeStack::OperationDefinitionStrategy

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



53
54
55
# File 'lib/graph_ql/static_validation/type_stack.rb', line 53

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

#push(stack, node) ⇒ Object



48
49
50
51
52
# File 'lib/graph_ql/static_validation/type_stack.rb', line 48

def push(stack, node)
  # query or mutation
  object_type = stack.schema.public_send(node.operation_type)
  stack.object_types.push(object_type)
end