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



83
84
85
# File 'lib/graphql/static_validation/type_stack.rb', line 83

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

#push(stack, node) ⇒ Object



77
78
79
80
81
# File 'lib/graphql/static_validation/type_stack.rb', line 77

def push(stack, node)
  # eg, QueryType, MutationType
  object_type = stack.schema.root_type_for_operation(node.operation_type)
  stack.object_types.push(object_type)
end