Skip to content
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
30 changes: 21 additions & 9 deletions src/graphql/execution/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -956,12 +956,16 @@ def execute_field(
try:
# Build a dictionary of arguments from the field.arguments AST, using the
# variables scope to fulfill any variable references.
args = get_argument_values(
field_def,
first_field_node,
self.variable_values,
first_field_details.fragment_variable_values,
self.hide_suggestions,
args = (
get_argument_values(
field_def,
first_field_node,
self.variable_values,
first_field_details.fragment_variable_values,
self.hide_suggestions,
)
if field_def.args or first_field_node.arguments
else {}
)

# Note that contrary to the JavaScript implementation, we pass the context
Expand All @@ -988,19 +992,27 @@ def execute_field(
)
if self.is_awaitable(completed):

async def await_completed() -> Any:
async def await_completed(
executor: Executor,
completed: Awaitable[Any],
return_type: GraphQLOutputType,
field_details_list: FieldDetailsList,
path: Path,
) -> Any:
try:
return await completed
except Exception as raw_error:
self.handle_field_error(
executor.handle_field_error(
raw_error,
return_type,
field_details_list,
path,
)
return None

return await_completed()
return await_completed(
self, completed, return_type, field_details_list, path
)

except Exception as raw_error:
self.handle_field_error(
Expand Down
Loading