Class: GraphQL::Schema::Member::Instrumentation::ProxiedResolve Private

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/schema/member/instrumentation.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initialize(inner_resolve:, list_depth:, inner_return_type:) ⇒ ProxiedResolve

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ProxiedResolve



67
68
69
70
71
# File 'lib/graphql/schema/member/instrumentation.rb', line 67

def initialize(inner_resolve:, list_depth:, inner_return_type:)
  @inner_resolve = inner_resolve
  @inner_return_type = inner_return_type
  @list_depth = list_depth
end

Instance Method Details

#call(obj, args, ctx) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



73
74
75
76
77
78
79
80
81
82
83
# File 'lib/graphql/schema/member/instrumentation.rb', line 73

def call(obj, args, ctx)
  result = @inner_resolve.call(obj, args, ctx)
  if ctx.schema.lazy?(result)
    # Wrap it later
    result
  elsif ctx.skip == result
    result
  else
    proxy_to_depth(result, @list_depth, @inner_return_type, ctx)
  end
end