Skip to content

Commit 5bfb52a

Browse files
committed
Align calls of ExecutionContext.build
Replicates graphql/graphql-js@239aa33
1 parent 1d83cfd commit 5bfb52a

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/graphql/execution/subscribe.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -129,23 +129,23 @@ async def create_source_event_stream(
129129
# mistake which should throw an early error.
130130
assert_valid_execution_arguments(schema, document, variable_values)
131131

132-
try:
133-
# If a valid context cannot be created due to incorrect arguments,
134-
# this will throw an error.
135-
context = ExecutionContext.build(
136-
schema,
137-
document,
138-
root_value,
139-
context_value,
140-
variable_values,
141-
operation_name,
142-
field_resolver,
143-
)
132+
# If a valid context cannot be created due to incorrect arguments,
133+
# a "Response" with only errors is returned.
134+
context = ExecutionContext.build(
135+
schema,
136+
document,
137+
root_value,
138+
context_value,
139+
variable_values,
140+
operation_name,
141+
field_resolver,
142+
)
144143

145-
# Return early errors if execution context failed.
146-
if isinstance(context, list):
147-
return ExecutionResult(data=None, errors=context)
144+
# Return early errors if execution context failed.
145+
if isinstance(context, list):
146+
return ExecutionResult(data=None, errors=context)
148147

148+
try:
149149
event_stream = await execute_subscription(context)
150150

151151
# Assert field returned an event stream, otherwise yield an error.

0 commit comments

Comments
 (0)