lib/graphql/schema/member/instrumentation.rb in graphql-1.8.0.pre1 vs lib/graphql/schema/member/instrumentation.rb in graphql-1.8.0.pre2
- old
+ new
@@ -83,13 +83,13 @@
end
private
def proxy_to_depth(obj, depth, type, ctx)
- if depth > 0
- obj.map { |inner_obj| proxy_to_depth(inner_obj, depth - 1, type, ctx) }
- elsif obj.nil?
+ if obj.nil?
obj
+ elsif depth > 0
+ obj.map { |inner_obj| proxy_to_depth(inner_obj, depth - 1, type, ctx) }
else
concrete_type = case type
when GraphQL::UnionType, GraphQL::InterfaceType
ctx.query.resolve_type(type, obj)
when GraphQL::ObjectType