diff --git a/src/graphql/execution/execute.py b/src/graphql/execution/execute.py index 4ddff2ad..d6e7fea2 100644 --- a/src/graphql/execution/execute.py +++ b/src/graphql/execution/execute.py @@ -315,7 +315,9 @@ async def build_response_async(): return ExecutionResult(data, None) # Sort the error list in order to make it deterministic, since we might have # been using parallel execution. - errors.sort(key=lambda error: (error.locations, error.path, error.message)) + errors.sort( + key=lambda error: (error.locations or [], error.path or [], error.message) + ) return ExecutionResult(data, errors) def execute_operation(