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.



73
74
75
76
77
# File 'lib/graphql/schema/member/instrumentation.rb', line 73

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.



79
80
81
82
83
84
85
86
87
# File 'lib/graphql/schema/member/instrumentation.rb', line 79

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