Skip to content

Commit 170c5df

Browse files
committed
Use fresh state for list item dataloader fibers
1 parent 3584553 commit 170c5df

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/graphql/execution/interpreter/runtime.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ def continue_field(value, owner_type, field, current_type, ast_node, next_select
761761
idx += 1
762762
if use_dataloader_job
763763
@dataloader.append_job do
764-
resolve_list_item(inner_value, inner_type, inner_type_non_null, ast_node, field, owner_object, arguments, this_idx, response_list, owner_type, was_scoped, runtime_state)
764+
resolve_list_item(inner_value, inner_type, inner_type_non_null, ast_node, field, owner_object, arguments, this_idx, response_list, owner_type, was_scoped, nil)
765765
end
766766
else
767767
resolve_list_item(inner_value, inner_type, inner_type_non_null, ast_node, field, owner_object, arguments, this_idx, response_list, owner_type, was_scoped, runtime_state)
@@ -803,6 +803,7 @@ def continue_field(value, owner_type, field, current_type, ast_node, next_select
803803
end
804804

805805
def resolve_list_item(inner_value, inner_type, inner_type_non_null, ast_node, field, owner_object, arguments, this_idx, response_list, owner_type, was_scoped, runtime_state) # rubocop:disable Metrics/ParameterLists
806+
runtime_state ||= get_current_runtime_state
806807
runtime_state.current_result_name = this_idx
807808
runtime_state.current_result = response_list
808809
call_method_on_directives(:resolve_each, owner_object, ast_node.directives) do

0 commit comments

Comments
 (0)