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
# File 'lib/graphql/schema/member/instrumentation.rb', line 73

def call(obj, args, ctx)
  result = @inner_resolve.call(obj, args, ctx)
  if ctx.skip == result || ctx.schema.lazy?(result) || result.nil? || result.is_a?(GraphQL::ExecutionError) || ctx.wrapped_object
    result
  else
    ctx.wrapped_object = true
    proxy_to_depth(result, @list_depth, ctx)
  end
end