Skip to content

Remove needless job counting #5392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions lib/graphql/execution/interpreter/runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,6 @@ def evaluate_selections(gathered_selections, selections_result, target_result, r
end

call_method_on_directives(:resolve, selections_result.graphql_application_value, directives) do
finished_jobs = 0
enqueued_jobs = gathered_selections.size
gathered_selections.each do |result_name, field_ast_nodes_or_ast_node|
# Field resolution may pause the fiber,
# so it wouldn't get to the `Resolve` call that happens below.
Expand All @@ -310,28 +308,19 @@ def evaluate_selections(gathered_selections, selections_result, target_result, r
evaluate_selection(
result_name, field_ast_nodes_or_ast_node, selections_result
)
finished_jobs += 1
if finished_jobs == enqueued_jobs
if target_result
selections_result.merge_into(target_result)
end
end
@dataloader.clear_cache
}
else
@dataloader.append_job {
evaluate_selection(
result_name, field_ast_nodes_or_ast_node, selections_result
)
finished_jobs += 1
if finished_jobs == enqueued_jobs
if target_result
selections_result.merge_into(target_result)
end
end
}
end
end
if target_result
selections_result.merge_into(target_result)
end
selections_result
end
end
Expand Down
Loading