@@ -230,7 +230,6 @@ def run_eager
230230 call_method_on_directives ( :resolve , object_proxy , selections . graphql_directives ) do
231231 evaluate_selections (
232232 path ,
233- context . scoped_context ,
234233 object_proxy ,
235234 root_type ,
236235 root_op_type == "mutation" ,
@@ -349,15 +348,15 @@ def gather_selections(owner_object, owner_type, selections, selections_to_run =
349348 NO_ARGS = { } . freeze
350349
351350 # @return [void]
352- def evaluate_selections ( path , scoped_context , owner_object , owner_type , is_eager_selection , gathered_selections , selections_result , target_result , parent_object ) # rubocop:disable Metrics/ParameterLists
351+ def evaluate_selections ( path , owner_object , owner_type , is_eager_selection , gathered_selections , selections_result , target_result , parent_object ) # rubocop:disable Metrics/ParameterLists
353352 set_all_interpreter_context ( owner_object , nil , nil , path )
354353
355354 finished_jobs = 0
356355 enqueued_jobs = gathered_selections . size
357356 gathered_selections . each do |result_name , field_ast_nodes_or_ast_node |
358357 @dataloader . append_job {
359358 evaluate_selection (
360- path , result_name , field_ast_nodes_or_ast_node , scoped_context , owner_object , owner_type , is_eager_selection , selections_result , parent_object
359+ path , result_name , field_ast_nodes_or_ast_node , owner_object , owner_type , is_eager_selection , selections_result , parent_object
361360 )
362361 finished_jobs += 1
363362 if target_result && finished_jobs == enqueued_jobs
@@ -372,7 +371,7 @@ def evaluate_selections(path, scoped_context, owner_object, owner_type, is_eager
372371 attr_reader :progress_path
373372
374373 # @return [void]
375- def evaluate_selection ( path , result_name , field_ast_nodes_or_ast_node , scoped_context , owner_object , owner_type , is_eager_field , selections_result , parent_object ) # rubocop:disable Metrics/ParameterLists
374+ def evaluate_selection ( path , result_name , field_ast_nodes_or_ast_node , owner_object , owner_type , is_eager_field , selections_result , parent_object ) # rubocop:disable Metrics/ParameterLists
376375 return if dead_result? ( selections_result )
377376 # As a performance optimization, the hash key will be a `Node` if
378377 # there's only one selection of the field. But if there are multiple
@@ -414,8 +413,6 @@ def evaluate_selection(path, result_name, field_ast_nodes_or_ast_node, scoped_co
414413 end
415414 # Set this before calling `run_with_directives`, so that the directive can have the latest path
416415 set_all_interpreter_context ( nil , field_defn , nil , next_path )
417-
418- context . scoped_context = scoped_context
419416 object = owner_object
420417
421418 if is_introspection
@@ -425,19 +422,18 @@ def evaluate_selection(path, result_name, field_ast_nodes_or_ast_node, scoped_co
425422 total_args_count = field_defn . arguments ( context ) . size
426423 if total_args_count == 0
427424 resolved_arguments = GraphQL ::Execution ::Interpreter ::Arguments ::EMPTY
428- evaluate_selection_with_args ( resolved_arguments , field_defn , next_path , ast_node , field_ast_nodes , scoped_context , owner_type , object , is_eager_field , result_name , selections_result , parent_object )
425+ evaluate_selection_with_args ( resolved_arguments , field_defn , next_path , ast_node , field_ast_nodes , owner_type , object , is_eager_field , result_name , selections_result , parent_object )
429426 else
430427 # TODO remove all arguments(...) usages?
431428 @query . arguments_cache . dataload_for ( ast_node , field_defn , object ) do |resolved_arguments |
432- evaluate_selection_with_args ( resolved_arguments , field_defn , next_path , ast_node , field_ast_nodes , scoped_context , owner_type , object , is_eager_field , result_name , selections_result , parent_object )
429+ evaluate_selection_with_args ( resolved_arguments , field_defn , next_path , ast_node , field_ast_nodes , owner_type , object , is_eager_field , result_name , selections_result , parent_object )
433430 end
434431 end
435432 end
436433
437- def evaluate_selection_with_args ( arguments , field_defn , next_path , ast_node , field_ast_nodes , scoped_context , owner_type , object , is_eager_field , result_name , selection_result , parent_object ) # rubocop:disable Metrics/ParameterLists
438- context . scoped_context = scoped_context
434+ def evaluate_selection_with_args ( arguments , field_defn , next_path , ast_node , field_ast_nodes , owner_type , object , is_eager_field , result_name , selection_result , parent_object ) # rubocop:disable Metrics/ParameterLists
439435 return_type = field_defn . type
440- after_lazy ( arguments , owner : owner_type , field : field_defn , path : next_path , ast_node : ast_node , scoped_context : context . scoped_context , owner_object : object , arguments : arguments , result_name : result_name , result : selection_result ) do |resolved_arguments |
436+ after_lazy ( arguments , owner : owner_type , field : field_defn , path : next_path , ast_node : ast_node , owner_object : object , arguments : arguments , result_name : result_name , result : selection_result ) do |resolved_arguments |
441437 if resolved_arguments . is_a? ( GraphQL ::ExecutionError ) || resolved_arguments . is_a? ( GraphQL ::UnauthorizedError )
442438 continue_value ( next_path , resolved_arguments , owner_type , field_defn , return_type . non_null? , ast_node , result_name , selection_result )
443439 next
@@ -510,7 +506,7 @@ def evaluate_selection_with_args(arguments, field_defn, next_path, ast_node, fie
510506 rescue GraphQL ::ExecutionError => err
511507 err
512508 end
513- after_lazy ( app_result , owner : owner_type , field : field_defn , path : next_path , ast_node : ast_node , scoped_context : context . scoped_context , owner_object : object , arguments : resolved_arguments , result_name : result_name , result : selection_result ) do |inner_result |
509+ after_lazy ( app_result , owner : owner_type , field : field_defn , path : next_path , ast_node : ast_node , owner_object : object , arguments : resolved_arguments , result_name : result_name , result : selection_result ) do |inner_result |
514510 continue_value = continue_value ( next_path , inner_result , owner_type , field_defn , return_type . non_null? , ast_node , result_name , selection_result )
515511 if HALT != continue_value
516512 continue_field ( next_path , continue_value , owner_type , field_defn , return_type , ast_node , next_selections , false , object , resolved_arguments , result_name , selection_result )
@@ -688,7 +684,7 @@ def continue_field(path, value, owner_type, field, current_type, ast_node, next_
688684 resolved_type_or_lazy , resolved_value = resolve_type ( current_type , value , path )
689685 resolved_value ||= value
690686
691- after_lazy ( resolved_type_or_lazy , owner : current_type , path : path , ast_node : ast_node , scoped_context : context . scoped_context , field : field , owner_object : owner_object , arguments : arguments , trace : false , result_name : result_name , result : selection_result ) do |resolved_type |
687+ after_lazy ( resolved_type_or_lazy , owner : current_type , path : path , ast_node : ast_node , field : field , owner_object : owner_object , arguments : arguments , trace : false , result_name : result_name , result : selection_result ) do |resolved_type |
692688 possible_types = query . possible_types ( current_type )
693689
694690 if !possible_types . include? ( resolved_type )
@@ -708,7 +704,7 @@ def continue_field(path, value, owner_type, field, current_type, ast_node, next_
708704 rescue GraphQL ::ExecutionError => err
709705 err
710706 end
711- after_lazy ( object_proxy , owner : current_type , path : path , ast_node : ast_node , scoped_context : context . scoped_context , field : field , owner_object : owner_object , arguments : arguments , trace : false , result_name : result_name , result : selection_result ) do |inner_object |
707+ after_lazy ( object_proxy , owner : current_type , path : path , ast_node : ast_node , field : field , owner_object : owner_object , arguments : arguments , trace : false , result_name : result_name , result : selection_result ) do |inner_object |
712708 continue_value = continue_value ( path , inner_object , owner_type , field , is_non_null , ast_node , result_name , selection_result )
713709 if HALT != continue_value
714710 response_hash = GraphQLResultHash . new ( result_name , selection_result )
@@ -734,7 +730,6 @@ def continue_field(path, value, owner_type, field, current_type, ast_node, next_
734730 call_method_on_directives ( :resolve , continue_value , selections . graphql_directives ) do
735731 evaluate_selections (
736732 path ,
737- context . scoped_context ,
738733 continue_value ,
739734 current_type ,
740735 false ,
@@ -757,7 +752,6 @@ def continue_field(path, value, owner_type, field, current_type, ast_node, next_
757752 set_result ( selection_result , result_name , response_list )
758753
759754 idx = 0
760- scoped_context = context . scoped_context
761755 begin
762756 value . each do |inner_value |
763757 break if dead_result? ( response_list )
@@ -768,10 +762,10 @@ def continue_field(path, value, owner_type, field, current_type, ast_node, next_
768762 idx += 1
769763 if use_dataloader_job
770764 @dataloader . append_job do
771- resolve_list_item ( inner_value , inner_type , next_path , ast_node , scoped_context , field , owner_object , arguments , this_idx , response_list , next_selections , owner_type )
765+ resolve_list_item ( inner_value , inner_type , next_path , ast_node , field , owner_object , arguments , this_idx , response_list , next_selections , owner_type )
772766 end
773767 else
774- resolve_list_item ( inner_value , inner_type , next_path , ast_node , scoped_context , field , owner_object , arguments , this_idx , response_list , next_selections , owner_type )
768+ resolve_list_item ( inner_value , inner_type , next_path , ast_node , field , owner_object , arguments , this_idx , response_list , next_selections , owner_type )
775769 end
776770 end
777771 rescue NoMethodError => err
@@ -791,11 +785,11 @@ def continue_field(path, value, owner_type, field, current_type, ast_node, next_
791785 end
792786 end
793787
794- def resolve_list_item ( inner_value , inner_type , next_path , ast_node , scoped_context , field , owner_object , arguments , this_idx , response_list , next_selections , owner_type ) # rubocop:disable Metrics/ParameterLists
788+ def resolve_list_item ( inner_value , inner_type , next_path , ast_node , field , owner_object , arguments , this_idx , response_list , next_selections , owner_type ) # rubocop:disable Metrics/ParameterLists
795789 set_all_interpreter_context ( nil , nil , nil , next_path )
796790 call_method_on_directives ( :resolve_each , owner_object , ast_node . directives ) do
797791 # This will update `response_list` with the lazy
798- after_lazy ( inner_value , owner : inner_type , path : next_path , ast_node : ast_node , scoped_context : scoped_context , field : field , owner_object : owner_object , arguments : arguments , result_name : this_idx , result : response_list ) do |inner_inner_value |
792+ after_lazy ( inner_value , owner : inner_type , path : next_path , ast_node : ast_node , field : field , owner_object : owner_object , arguments : arguments , result_name : this_idx , result : response_list ) do |inner_inner_value |
799793 continue_value = continue_value ( next_path , inner_inner_value , owner_type , field , inner_type . non_null? , ast_node , this_idx , response_list )
800794 if HALT != continue_value
801795 continue_field ( next_path , continue_value , owner_type , field , inner_type , ast_node , next_selections , false , owner_object , arguments , this_idx , response_list )
@@ -870,11 +864,10 @@ def set_all_interpreter_context(object, field, arguments, path)
870864 # @param eager [Boolean] Set to `true` for mutation root fields only
871865 # @param trace [Boolean] If `false`, don't wrap this with field tracing
872866 # @return [GraphQL::Execution::Lazy, Object] If loading `object` will be deferred, it's a wrapper over it.
873- def after_lazy ( lazy_obj , owner :, field :, path :, scoped_context : , owner_object :, arguments :, ast_node :, result :, result_name :, eager : false , trace : true , &block )
867+ def after_lazy ( lazy_obj , owner :, field :, path :, owner_object :, arguments :, ast_node :, result :, result_name :, eager : false , trace : true , &block )
874868 if lazy? ( lazy_obj )
875869 lazy = GraphQL ::Execution ::Lazy . new ( path : path , field : field ) do
876870 set_all_interpreter_context ( owner_object , field , arguments , path )
877- context . scoped_context = scoped_context
878871 # Wrap the execution of _this_ method with tracing,
879872 # but don't wrap the continuation below
880873 inner_obj = begin
0 commit comments