59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
# File 'lib/graph_ql/static_validation/type_stack.rb', line 59
def push(stack, node)
parent_type = stack.object_types.last
parent_type = parent_type.kind.unwrap(parent_type)
if parent_type.kind.fields?
field_class = parent_type.fields[node.name]
stack.field_definitions.push(field_class)
if !field_class.nil?
next_object_type = field_class.type
stack.object_types.push(next_object_type)
else
stack.object_types.push(nil)
end
else
stack.field_definitions.push(nil)
stack.object_types.push(parent_type)
end
end
|