Module: GraphQL::StaticValidation::TypeStack::OperationDefinitionStrategy

Defined in:
lib/graphql/static_validation/type_stack.rb

Class Method Summary collapse

Class Method Details

.pop(stack, node) ⇒ Object


102
103
104
105
# File 'lib/graphql/static_validation/type_stack.rb', line 102

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

.push(stack, node) ⇒ Object


95
96
97
98
99
100
# File 'lib/graphql/static_validation/type_stack.rb', line 95

def push(stack, node)
  # eg, QueryType, MutationType
  object_type = stack.schema.root_type_for_operation(node.operation_type)
  stack.object_types.push(object_type)
  stack.path.push("#{node.operation_type}#{node.name ? " #{node.name}" : ""}")
end