prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <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.
  
  </issue>
  <code>
  [start of strawberry/utils/debug.py]
  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 of strawberry/utils/debug.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: 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()))
  
verification_info: {"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"}]}