Repository: strawberry-graphql/strawberry

Issue:
After the 0.135.0 release, invalid GraphQL queries are not logged as errors
## Describe the Bug
Before the 0.135.0 invalid queries were logged as errors. For example, given following schema:
```python
import strawberry

@strawberry.type
class Query:
    @strawberry.field
    def version(self) -> int:
        return 139


schema = strawberry.schema.Schema(query=Query)
```
When executing a query: `query { v }` the error will be logged:
```
Cannot query field 'v' on type 'Query'.

GraphQL request:1:9
1 | query { v }
  |         ^
Stack (most recent call last):
...
```
After the update to 0.135.0 the log is silent on this.

## System Information

 - Operating system: Fedora Linux 36
 - Strawberry version (if applicable): >=0.135.0



Discussion:

Resolving patch:
diff --git a/strawberry/schema/execute.py b/strawberry/schema/execute.py
--- a/strawberry/schema/execute.py
+++ b/strawberry/schema/execute.py
@@ -86,6 +86,7 @@ async def execute(
 
             except GraphQLError as error:
                 execution_context.errors = [error]
+                process_errors([error], execution_context)
                 return ExecutionResult(
                     data=None,
                     errors=[error],
@@ -96,6 +97,8 @@ async def execute(
                 error = GraphQLError(str(error), original_error=error)
 
                 execution_context.errors = [error]
+                process_errors([error], execution_context)
+
                 return ExecutionResult(
                     data=None,
                     errors=[error],
@@ -108,6 +111,7 @@ async def execute(
         async with extensions_runner.validation():
             _run_validation(execution_context)
             if execution_context.errors:
+                process_errors(execution_context.errors, execution_context)
                 return ExecutionResult(data=None, errors=execution_context.errors)
 
         async with extensions_runner.executing():
@@ -172,6 +176,7 @@ def execute_sync(
 
             except GraphQLError as error:
                 execution_context.errors = [error]
+                process_errors([error], execution_context)
                 return ExecutionResult(
                     data=None,
                     errors=[error],
@@ -182,6 +187,7 @@ def execute_sync(
                 error = GraphQLError(str(error), original_error=error)
 
                 execution_context.errors = [error]
+                process_errors([error], execution_context)
                 return ExecutionResult(
                     data=None,
                     errors=[error],
@@ -194,6 +200,7 @@ def execute_sync(
         with extensions_runner.validation():
             _run_validation(execution_context)
             if execution_context.errors:
+                process_errors(execution_context.errors, execution_context)
                 return ExecutionResult(data=None, errors=execution_context.errors)
 
         with extensions_runner.executing():


Test patch:
diff --git a/tests/schema/test_execution.py b/tests/schema/test_execution.py
--- a/tests/schema/test_execution.py
+++ b/tests/schema/test_execution.py
@@ -240,6 +240,148 @@ def example(self) -> int:
     assert record.exc_info[0] is TypeError
 
 
+@pytest.mark.asyncio
+async def test_logging_parsing_error(caplog):
+    @strawberry.type
+    class Query:
+        @strawberry.field
+        def example(self) -> str:
+            return "hi"
+
+    schema = strawberry.Schema(query=Query)
+
+    query = """
+        query {
+            example
+    """
+
+    result = await schema.execute(
+        query,
+        root_value=Query(),
+    )
+
+    assert result.errors
+    assert len(result.errors) == 1
+
+    # Exception was logged
+    assert len(caplog.records) == 1
+    record = caplog.records[0]
+
+    assert record.levelname == "ERROR"
+    assert record.name == "strawberry.execution"
+    assert "Syntax Error" in record.message
+
+
+def test_logging_parsing_error_sync(caplog):
+    @strawberry.type
+    class Query:
+        @strawberry.field
+        def example(self) -> str:
+            return "hi"
+
+    schema = strawberry.Schema(query=Query)
+
+    query = """
+        query {
+            example
+    """
+
+    result = schema.execute_sync(
+        query,
+        root_value=Query(),
+    )
+
+    assert result.errors
+    assert len(result.errors) == 1
+
+    # Exception was logged
+    assert len(caplog.records) == 1
+    record = caplog.records[0]
+
+    assert record.levelname == "ERROR"
+    assert record.name == "strawberry.execution"
+    assert "Syntax Error" in record.message
+
+
+@pytest.mark.asyncio
+async def test_logging_validation_errors(caplog):
+    @strawberry.type
+    class Query:
+        @strawberry.field
+        def example(self) -> str:
+            return "hi"
+
+    schema = strawberry.Schema(query=Query)
+
+    query = """
+        query {
+            example {
+                foo
+            }
+            missingField
+        }
+    """
+
+    result = await schema.execute(
+        query,
+        root_value=Query(),
+    )
+
+    assert result.errors
+    assert len(result.errors) == 2
+
+    # Exception was logged
+    assert len(caplog.records) == 2
+    record1 = caplog.records[0]
+    assert record1.levelname == "ERROR"
+    assert record1.name == "strawberry.execution"
+    assert "Field 'example' must not have a selection" in record1.message
+
+    record2 = caplog.records[1]
+    assert record2.levelname == "ERROR"
+    assert record2.name == "strawberry.execution"
+    assert "Cannot query field 'missingField'" in record2.message
+
+
+def test_logging_validation_errors_sync(caplog):
+    @strawberry.type
+    class Query:
+        @strawberry.field
+        def example(self) -> str:
+            return "hi"
+
+    schema = strawberry.Schema(query=Query)
+
+    query = """
+        query {
+            example {
+                foo
+            }
+            missingField
+        }
+    """
+
+    result = schema.execute_sync(
+        query,
+        root_value=Query(),
+    )
+
+    assert result.errors
+    assert len(result.errors) == 2
+
+    # Exception was logged
+    assert len(caplog.records) == 2
+    record1 = caplog.records[0]
+    assert record1.levelname == "ERROR"
+    assert record1.name == "strawberry.execution"
+    assert "Field 'example' must not have a selection" in record1.message
+
+    record2 = caplog.records[1]
+    assert record2.levelname == "ERROR"
+    assert record2.name == "strawberry.execution"
+    assert "Cannot query field 'missingField'" in record2.message
+
+
 def test_overriding_process_errors(caplog):
     @strawberry.type
     class Query: