Skip to content

Commit 65a49f1

Browse files
committed
Only finish_subscriptions on valid queries
1 parent b6ce8d6 commit 65a49f1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/graphql/execution/interpreter.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ def run_all(schema, query_options, context: {}, max_complexity: schema.max_compl
8888
# Then, find all errors and assign the result to the query object
8989
results.each_with_index do |data_result, idx|
9090
query = queries[idx]
91-
if query.subscription?
92-
schema.subscriptions.finish_subscriptions(query)
93-
end
9491
# Assign the result so that it can be accessed in instrumentation
9592
query.result_values = if data_result.equal?(NO_OPERATION)
9693
if !query.valid? || !query.context.errors.empty?
@@ -100,6 +97,9 @@ def run_all(schema, query_options, context: {}, max_complexity: schema.max_compl
10097
data_result
10198
end
10299
else
100+
if query.subscription?
101+
schema.subscriptions.finish_subscriptions(query)
102+
end
103103
result = {}
104104

105105
if !query.context.errors.empty?

0 commit comments

Comments
 (0)