We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
UploadFile causes ASGI application's exception when it is in debug mode
Apparently when we use the ASGI application in debug mode, it cannot print the value of variables if they are not JSON serializable.

In my use case, when I tried to use the [file upload](https://strawberry.rocks/docs/features/file-upload) example in debug mode this issue ended up happening.

I believe it is because of this:

https://github.com/strawberry-graphql/strawberry/blob/de215370b247a417af8a8dd5fc382d71e305bcd7/strawberry/utils/debug.py#L26-L29

Perhaps converting variables to string might help.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `strawberry/utils/debug.py`
Content:
```
1 import datetime
2 import json
3 import typing
4 
5 from pygments import highlight, lexers
6 from pygments.formatters import Terminal256Formatter
7 
8 from .graphql_lexer import GraphQLLexer
9 
10 
11 def pretty_print_graphql_operation(
12     operation_name: str, query: str, variables: typing.Dict["str", typing.Any]
13 ):  # pragma: no cover
14     """Pretty print a GraphQL operation using pygments.
15 
16     Won't print introspection operation to prevent noise in the output."""
17 
18     if operation_name == "IntrospectionQuery":
19         return
20 
21     now = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
22 
23     print(f"[{now}]: {operation_name or 'No operation name'}")
24     print(highlight(query, GraphQLLexer(), Terminal256Formatter()))
25 
26     if variables:
27         variables_json = json.dumps(variables, indent=4)
28 
29         print(highlight(variables_json, lexers.JsonLexer(), Terminal256Formatter()))
30
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/strawberry/utils/debug.py b/strawberry/utils/debug.py
--- a/strawberry/utils/debug.py
+++ b/strawberry/utils/debug.py
@@ -1,6 +1,7 @@
 import datetime
 import json
-import typing
+from json import JSONEncoder
+from typing import Any, Dict
 
 from pygments import highlight, lexers
 from pygments.formatters import Terminal256Formatter
@@ -8,9 +9,14 @@
 from .graphql_lexer import GraphQLLexer
 
 
+class StrawberryJSONEncoder(JSONEncoder):
+    def default(self, o: Any) -> Any:
+        return repr(o)
+
+
 def pretty_print_graphql_operation(
-    operation_name: str, query: str, variables: typing.Dict["str", typing.Any]
-):  # pragma: no cover
+    operation_name: str, query: str, variables: Dict["str", Any]
+):
     """Pretty print a GraphQL operation using pygments.
 
     Won't print introspection operation to prevent noise in the output."""
@@ -24,6 +30,6 @@
     print(highlight(query, GraphQLLexer(), Terminal256Formatter()))
 
     if variables:
-        variables_json = json.dumps(variables, indent=4)
+        variables_json = json.dumps(variables, indent=4, cls=StrawberryJSONEncoder)
 
         print(highlight(variables_json, lexers.JsonLexer(), Terminal256Formatter()))

{"golden_diff": "diff --git a/strawberry/utils/debug.py b/strawberry/utils/debug.py\n--- a/strawberry/utils/debug.py\n+++ b/strawberry/utils/debug.py\n@@ -1,6 +1,7 @@\n import datetime\n import json\n-import typing\n+from json import JSONEncoder\n+from typing import Any, Dict\n \n from pygments import highlight, lexers\n from pygments.formatters import Terminal256Formatter\n@@ -8,9 +9,14 @@\n from .graphql_lexer import GraphQLLexer\n \n \n+class StrawberryJSONEncoder(JSONEncoder):\n+    def default(self, o: Any) -> Any:\n+        return repr(o)\n+\n+\n def pretty_print_graphql_operation(\n-    operation_name: str, query: str, variables: typing.Dict[\"str\", typing.Any]\n-):  # pragma: no cover\n+    operation_name: str, query: str, variables: Dict[\"str\", Any]\n+):\n     \"\"\"Pretty print a GraphQL operation using pygments.\n \n     Won't print introspection operation to prevent noise in the output.\"\"\"\n@@ -24,6 +30,6 @@\n     print(highlight(query, GraphQLLexer(), Terminal256Formatter()))\n \n     if variables:\n-        variables_json = json.dumps(variables, indent=4)\n+        variables_json = json.dumps(variables, indent=4, cls=StrawberryJSONEncoder)\n \n         print(highlight(variables_json, lexers.JsonLexer(), Terminal256Formatter()))\n", "issue": "UploadFile causes ASGI application's exception when it is in debug mode\nApparently when we use the ASGI application in debug mode, it cannot print the value of variables if they are not JSON serializable.\r\n\r\nIn my use case, when I tried to use the [file upload](https://strawberry.rocks/docs/features/file-upload) example in debug mode this issue ended up happening.\r\n\r\nI believe it is because of this:\r\n\r\nhttps://github.com/strawberry-graphql/strawberry/blob/de215370b247a417af8a8dd5fc382d71e305bcd7/strawberry/utils/debug.py#L26-L29\r\n\r\nPerhaps converting variables to string might help.\n", "before_files": [{"content": "import datetime\nimport json\nimport typing\n\nfrom pygments import highlight, lexers\nfrom pygments.formatters import Terminal256Formatter\n\nfrom .graphql_lexer import GraphQLLexer\n\n\ndef pretty_print_graphql_operation(\n    operation_name: str, query: str, variables: typing.Dict[\"str\", typing.Any]\n):  # pragma: no cover\n    \"\"\"Pretty print a GraphQL operation using pygments.\n\n    Won't print introspection operation to prevent noise in the output.\"\"\"\n\n    if operation_name == \"IntrospectionQuery\":\n        return\n\n    now = datetime.datetime.now().strftime(\"%Y-%m-%d %H:%M:%S\")\n\n    print(f\"[{now}]: {operation_name or 'No operation name'}\")\n    print(highlight(query, GraphQLLexer(), Terminal256Formatter()))\n\n    if variables:\n        variables_json = json.dumps(variables, indent=4)\n\n        print(highlight(variables_json, lexers.JsonLexer(), Terminal256Formatter()))\n", "path": "strawberry/utils/debug.py"}], "after_files": [{"content": "import datetime\nimport json\nfrom json import JSONEncoder\nfrom typing import Any, Dict\n\nfrom pygments import highlight, lexers\nfrom pygments.formatters import Terminal256Formatter\n\nfrom .graphql_lexer import GraphQLLexer\n\n\nclass StrawberryJSONEncoder(JSONEncoder):\n    def default(self, o: Any) -> Any:\n        return repr(o)\n\n\ndef pretty_print_graphql_operation(\n    operation_name: str, query: str, variables: Dict[\"str\", Any]\n):\n    \"\"\"Pretty print a GraphQL operation using pygments.\n\n    Won't print introspection operation to prevent noise in the output.\"\"\"\n\n    if operation_name == \"IntrospectionQuery\":\n        return\n\n    now = datetime.datetime.now().strftime(\"%Y-%m-%d %H:%M:%S\")\n\n    print(f\"[{now}]: {operation_name or 'No operation name'}\")\n    print(highlight(query, GraphQLLexer(), Terminal256Formatter()))\n\n    if variables:\n        variables_json = json.dumps(variables, indent=4, cls=StrawberryJSONEncoder)\n\n        print(highlight(variables_json, lexers.JsonLexer(), Terminal256Formatter()))\n", "path": "strawberry/utils/debug.py"}]}