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

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


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

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

#push(stack, node) ⇒ Object


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

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