Module: GraphQL::Field::DefaultLazyResolve

Defined in:
lib/graphql/field.rb

Class Method Summary collapse

Class Method Details

.call(obj, args, ctx) ⇒ Object



325
326
327
328
329
330
331
332
333
# File 'lib/graphql/field.rb', line 325

def self.call(obj, args, ctx)
  method_name = ctx.schema.lazy_method_name(obj)
  next_obj = obj.public_send(method_name)
  if ctx.schema.lazy?(next_obj)
    call(next_obj, args, ctx)
  else
    next_obj
  end
end