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



76
77
78
# File 'lib/graphql/static_validation/type_stack.rb', line 76

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

#push(stack, node) ⇒ Object



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

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