Skip to content
Snippets Groups Projects

[graphql] Convert to using the new query interpreter runtime

Merged Brett Walker requested to merge bw-graphql-interpreter into master
3 files
+ 29
24
Compare changes
  • Side-by-side
  • Inline
Files
3
# frozen_string_literal: true
module FindClosest
# TODO: original code
# Find the closest node which has any of the given types above this node, and return the domain object
# def closest_parent(types, parent)
# while parent
#
# if parent.respond_to?(:object) && types.any? {|type| parent.object.instance_of? type}
# return parent.object.object
# else
# parent = parent.try(:parent)
# end
# end
# end
# def closest_parent(types, parent)
# while parent
#
# if parent.respond_to?(:object) && types.any? {|type| parent.object.instance_of? type}
# return parent.object.object
# else
# parent = parent.try(:parent)
# end
# end
# end
# TODO: temporary rework - let's see if this works
# def closest_parent(types, parent)
@@ -32,6 +32,7 @@ module FindClosest
# must also pass
def closest_parent(types, parent)
while parent
if types.any? {|type| parent.instance_of? type}
return parent
else
Loading