We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Python 3.12 has deprecation warnings
Ariadne produces few warnings when ran on Py3.12. Most of those are out of our hands as they are coming from dependencies, but there are some we should fix:

```

  /ariadne/ariadne/contrib/tracing/apollotracing.py:36: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
    self.start_date = datetime.utcnow()

  /ariadne/ariadne/contrib/tracing/apollotracing.py:96: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
    "end": datetime.utcnow(),
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `ariadne/contrib/tracing/apollotracing.py`
Content:
```
1 from datetime import datetime
2 from inspect import iscoroutinefunction
3 from typing import Any, List, Optional, cast
4 
5 from graphql import GraphQLResolveInfo
6 from graphql.pyutils import is_awaitable
7 
8 from ...types import ContextValue, Extension, Resolver
9 from .utils import format_path, should_trace
10 
11 try:
12     from time import perf_counter_ns
13 except ImportError:
14     # Py 3.6 fallback
15     from time import perf_counter
16 
17     NS_IN_SECOND = 1000000000
18 
19     def perf_counter_ns() -> int:
20         return int(perf_counter() * NS_IN_SECOND)
21 
22 
23 TIMESTAMP_FORMAT = "%Y-%m-%dT%H:%M:%S.%fZ"
24 
25 
26 class ApolloTracingExtension(Extension):
27     def __init__(self, trace_default_resolver: bool = False) -> None:
28         self.trace_default_resolver = trace_default_resolver
29         self.start_date: Optional[datetime] = None
30         self.start_timestamp: int = 0
31         self.resolvers: List[dict] = []
32 
33         self._totals = None
34 
35     def request_started(self, context: ContextValue):
36         self.start_date = datetime.utcnow()
37         self.start_timestamp = perf_counter_ns()
38 
39     def resolve(self, next_: Resolver, obj: Any, info: GraphQLResolveInfo, **kwargs):
40         if not should_trace(info, self.trace_default_resolver):
41             return next_(obj, info, **kwargs)
42 
43         if iscoroutinefunction(next_):
44             return self.resolve_async(next_, obj, info, **kwargs)
45 
46         return self.resolve_sync(next_, obj, info, **kwargs)
47 
48     async def resolve_async(
49         self, next_: Resolver, obj: Any, info: GraphQLResolveInfo, **kwargs
50     ):
51         start_timestamp = perf_counter_ns()
52         record = {
53             "path": format_path(info.path),
54             "parentType": str(info.parent_type),
55             "fieldName": info.field_name,
56             "returnType": str(info.return_type),
57             "startOffset": start_timestamp - cast(int, self.start_timestamp),
58         }
59         self.resolvers.append(record)
60         try:
61             result = next_(obj, info, **kwargs)
62             if is_awaitable(result):
63                 result = await result
64             return result
65         finally:
66             end_timestamp = perf_counter_ns()
67             record["duration"] = end_timestamp - start_timestamp
68 
69     def resolve_sync(
70         self, next_: Resolver, obj: Any, info: GraphQLResolveInfo, **kwargs
71     ):
72         start_timestamp = perf_counter_ns()
73         record = {
74             "path": format_path(info.path),
75             "parentType": str(info.parent_type),
76             "fieldName": info.field_name,
77             "returnType": str(info.return_type),
78             "startOffset": start_timestamp - cast(int, self.start_timestamp),
79         }
80         self.resolvers.append(record)
81         try:
82             result = next_(obj, info, **kwargs)
83             return result
84         finally:
85             end_timestamp = perf_counter_ns()
86             record["duration"] = end_timestamp - start_timestamp
87 
88     def get_totals(self):
89         if self._totals is None:
90             self._totals = self._get_totals()
91         return self._totals
92 
93     def _get_totals(self):
94         return {
95             "start": self.start_date,
96             "end": datetime.utcnow(),
97             "duration": perf_counter_ns() - self.start_timestamp,
98             "resolvers": self.resolvers,
99         }
100 
101     def format(self, context: ContextValue):
102         totals = self.get_totals()
103 
104         return {
105             "tracing": {
106                 "version": 1,
107                 "startTime": totals["start"].strftime(TIMESTAMP_FORMAT),
108                 "endTime": totals["end"].strftime(TIMESTAMP_FORMAT),
109                 "duration": totals["duration"],
110                 "execution": {"resolvers": totals["resolvers"]},
111             }
112         }
113
```
--- 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/ariadne/contrib/tracing/apollotracing.py b/ariadne/contrib/tracing/apollotracing.py
--- a/ariadne/contrib/tracing/apollotracing.py
+++ b/ariadne/contrib/tracing/apollotracing.py
@@ -1,4 +1,3 @@
-from datetime import datetime
 from inspect import iscoroutinefunction
 from typing import Any, List, Optional, cast
 
@@ -20,6 +19,19 @@
         return int(perf_counter() * NS_IN_SECOND)
 
 
+try:
+    from datetime import UTC, datetime  # type: ignore[attr-defined]
+
+    def utc_now():
+        return datetime.now(UTC)
+
+except ImportError:
+    from datetime import datetime
+
+    def utc_now():
+        return datetime.utcnow()
+
+
 TIMESTAMP_FORMAT = "%Y-%m-%dT%H:%M:%S.%fZ"
 
 
@@ -33,7 +45,7 @@
         self._totals = None
 
     def request_started(self, context: ContextValue):
-        self.start_date = datetime.utcnow()
+        self.start_date = utc_now()
         self.start_timestamp = perf_counter_ns()
 
     def resolve(self, next_: Resolver, obj: Any, info: GraphQLResolveInfo, **kwargs):
@@ -93,7 +105,7 @@
     def _get_totals(self):
         return {
             "start": self.start_date,
-            "end": datetime.utcnow(),
+            "end": utc_now(),
             "duration": perf_counter_ns() - self.start_timestamp,
             "resolvers": self.resolvers,
         }

{"golden_diff": "diff --git a/ariadne/contrib/tracing/apollotracing.py b/ariadne/contrib/tracing/apollotracing.py\n--- a/ariadne/contrib/tracing/apollotracing.py\n+++ b/ariadne/contrib/tracing/apollotracing.py\n@@ -1,4 +1,3 @@\n-from datetime import datetime\n from inspect import iscoroutinefunction\n from typing import Any, List, Optional, cast\n \n@@ -20,6 +19,19 @@\n         return int(perf_counter() * NS_IN_SECOND)\n \n \n+try:\n+    from datetime import UTC, datetime  # type: ignore[attr-defined]\n+\n+    def utc_now():\n+        return datetime.now(UTC)\n+\n+except ImportError:\n+    from datetime import datetime\n+\n+    def utc_now():\n+        return datetime.utcnow()\n+\n+\n TIMESTAMP_FORMAT = \"%Y-%m-%dT%H:%M:%S.%fZ\"\n \n \n@@ -33,7 +45,7 @@\n         self._totals = None\n \n     def request_started(self, context: ContextValue):\n-        self.start_date = datetime.utcnow()\n+        self.start_date = utc_now()\n         self.start_timestamp = perf_counter_ns()\n \n     def resolve(self, next_: Resolver, obj: Any, info: GraphQLResolveInfo, **kwargs):\n@@ -93,7 +105,7 @@\n     def _get_totals(self):\n         return {\n             \"start\": self.start_date,\n-            \"end\": datetime.utcnow(),\n+            \"end\": utc_now(),\n             \"duration\": perf_counter_ns() - self.start_timestamp,\n             \"resolvers\": self.resolvers,\n         }\n", "issue": "Python 3.12 has deprecation warnings\nAriadne produces few warnings when ran on Py3.12. Most of those are out of our hands as they are coming from dependencies, but there are some we should fix:\r\n\r\n```\r\n\r\n  /ariadne/ariadne/contrib/tracing/apollotracing.py:36: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).\r\n    self.start_date = datetime.utcnow()\r\n\r\n  /ariadne/ariadne/contrib/tracing/apollotracing.py:96: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).\r\n    \"end\": datetime.utcnow(),\r\n```\n", "before_files": [{"content": "from datetime import datetime\nfrom inspect import iscoroutinefunction\nfrom typing import Any, List, Optional, cast\n\nfrom graphql import GraphQLResolveInfo\nfrom graphql.pyutils import is_awaitable\n\nfrom ...types import ContextValue, Extension, Resolver\nfrom .utils import format_path, should_trace\n\ntry:\n    from time import perf_counter_ns\nexcept ImportError:\n    # Py 3.6 fallback\n    from time import perf_counter\n\n    NS_IN_SECOND = 1000000000\n\n    def perf_counter_ns() -> int:\n        return int(perf_counter() * NS_IN_SECOND)\n\n\nTIMESTAMP_FORMAT = \"%Y-%m-%dT%H:%M:%S.%fZ\"\n\n\nclass ApolloTracingExtension(Extension):\n    def __init__(self, trace_default_resolver: bool = False) -> None:\n        self.trace_default_resolver = trace_default_resolver\n        self.start_date: Optional[datetime] = None\n        self.start_timestamp: int = 0\n        self.resolvers: List[dict] = []\n\n        self._totals = None\n\n    def request_started(self, context: ContextValue):\n        self.start_date = datetime.utcnow()\n        self.start_timestamp = perf_counter_ns()\n\n    def resolve(self, next_: Resolver, obj: Any, info: GraphQLResolveInfo, **kwargs):\n        if not should_trace(info, self.trace_default_resolver):\n            return next_(obj, info, **kwargs)\n\n        if iscoroutinefunction(next_):\n            return self.resolve_async(next_, obj, info, **kwargs)\n\n        return self.resolve_sync(next_, obj, info, **kwargs)\n\n    async def resolve_async(\n        self, next_: Resolver, obj: Any, info: GraphQLResolveInfo, **kwargs\n    ):\n        start_timestamp = perf_counter_ns()\n        record = {\n            \"path\": format_path(info.path),\n            \"parentType\": str(info.parent_type),\n            \"fieldName\": info.field_name,\n            \"returnType\": str(info.return_type),\n            \"startOffset\": start_timestamp - cast(int, self.start_timestamp),\n        }\n        self.resolvers.append(record)\n        try:\n            result = next_(obj, info, **kwargs)\n            if is_awaitable(result):\n                result = await result\n            return result\n        finally:\n            end_timestamp = perf_counter_ns()\n            record[\"duration\"] = end_timestamp - start_timestamp\n\n    def resolve_sync(\n        self, next_: Resolver, obj: Any, info: GraphQLResolveInfo, **kwargs\n    ):\n        start_timestamp = perf_counter_ns()\n        record = {\n            \"path\": format_path(info.path),\n            \"parentType\": str(info.parent_type),\n            \"fieldName\": info.field_name,\n            \"returnType\": str(info.return_type),\n            \"startOffset\": start_timestamp - cast(int, self.start_timestamp),\n        }\n        self.resolvers.append(record)\n        try:\n            result = next_(obj, info, **kwargs)\n            return result\n        finally:\n            end_timestamp = perf_counter_ns()\n            record[\"duration\"] = end_timestamp - start_timestamp\n\n    def get_totals(self):\n        if self._totals is None:\n            self._totals = self._get_totals()\n        return self._totals\n\n    def _get_totals(self):\n        return {\n            \"start\": self.start_date,\n            \"end\": datetime.utcnow(),\n            \"duration\": perf_counter_ns() - self.start_timestamp,\n            \"resolvers\": self.resolvers,\n        }\n\n    def format(self, context: ContextValue):\n        totals = self.get_totals()\n\n        return {\n            \"tracing\": {\n                \"version\": 1,\n                \"startTime\": totals[\"start\"].strftime(TIMESTAMP_FORMAT),\n                \"endTime\": totals[\"end\"].strftime(TIMESTAMP_FORMAT),\n                \"duration\": totals[\"duration\"],\n                \"execution\": {\"resolvers\": totals[\"resolvers\"]},\n            }\n        }\n", "path": "ariadne/contrib/tracing/apollotracing.py"}], "after_files": [{"content": "from inspect import iscoroutinefunction\nfrom typing import Any, List, Optional, cast\n\nfrom graphql import GraphQLResolveInfo\nfrom graphql.pyutils import is_awaitable\n\nfrom ...types import ContextValue, Extension, Resolver\nfrom .utils import format_path, should_trace\n\ntry:\n    from time import perf_counter_ns\nexcept ImportError:\n    # Py 3.6 fallback\n    from time import perf_counter\n\n    NS_IN_SECOND = 1000000000\n\n    def perf_counter_ns() -> int:\n        return int(perf_counter() * NS_IN_SECOND)\n\n\ntry:\n    from datetime import UTC, datetime  # type: ignore[attr-defined]\n\n    def utc_now():\n        return datetime.now(UTC)\n\nexcept ImportError:\n    from datetime import datetime\n\n    def utc_now():\n        return datetime.utcnow()\n\n\nTIMESTAMP_FORMAT = \"%Y-%m-%dT%H:%M:%S.%fZ\"\n\n\nclass ApolloTracingExtension(Extension):\n    def __init__(self, trace_default_resolver: bool = False) -> None:\n        self.trace_default_resolver = trace_default_resolver\n        self.start_date: Optional[datetime] = None\n        self.start_timestamp: int = 0\n        self.resolvers: List[dict] = []\n\n        self._totals = None\n\n    def request_started(self, context: ContextValue):\n        self.start_date = utc_now()\n        self.start_timestamp = perf_counter_ns()\n\n    def resolve(self, next_: Resolver, obj: Any, info: GraphQLResolveInfo, **kwargs):\n        if not should_trace(info, self.trace_default_resolver):\n            return next_(obj, info, **kwargs)\n\n        if iscoroutinefunction(next_):\n            return self.resolve_async(next_, obj, info, **kwargs)\n\n        return self.resolve_sync(next_, obj, info, **kwargs)\n\n    async def resolve_async(\n        self, next_: Resolver, obj: Any, info: GraphQLResolveInfo, **kwargs\n    ):\n        start_timestamp = perf_counter_ns()\n        record = {\n            \"path\": format_path(info.path),\n            \"parentType\": str(info.parent_type),\n            \"fieldName\": info.field_name,\n            \"returnType\": str(info.return_type),\n            \"startOffset\": start_timestamp - cast(int, self.start_timestamp),\n        }\n        self.resolvers.append(record)\n        try:\n            result = next_(obj, info, **kwargs)\n            if is_awaitable(result):\n                result = await result\n            return result\n        finally:\n            end_timestamp = perf_counter_ns()\n            record[\"duration\"] = end_timestamp - start_timestamp\n\n    def resolve_sync(\n        self, next_: Resolver, obj: Any, info: GraphQLResolveInfo, **kwargs\n    ):\n        start_timestamp = perf_counter_ns()\n        record = {\n            \"path\": format_path(info.path),\n            \"parentType\": str(info.parent_type),\n            \"fieldName\": info.field_name,\n            \"returnType\": str(info.return_type),\n            \"startOffset\": start_timestamp - cast(int, self.start_timestamp),\n        }\n        self.resolvers.append(record)\n        try:\n            result = next_(obj, info, **kwargs)\n            return result\n        finally:\n            end_timestamp = perf_counter_ns()\n            record[\"duration\"] = end_timestamp - start_timestamp\n\n    def get_totals(self):\n        if self._totals is None:\n            self._totals = self._get_totals()\n        return self._totals\n\n    def _get_totals(self):\n        return {\n            \"start\": self.start_date,\n            \"end\": utc_now(),\n            \"duration\": perf_counter_ns() - self.start_timestamp,\n            \"resolvers\": self.resolvers,\n        }\n\n    def format(self, context: ContextValue):\n        totals = self.get_totals()\n\n        return {\n            \"tracing\": {\n                \"version\": 1,\n                \"startTime\": totals[\"start\"].strftime(TIMESTAMP_FORMAT),\n                \"endTime\": totals[\"end\"].strftime(TIMESTAMP_FORMAT),\n                \"duration\": totals[\"duration\"],\n                \"execution\": {\"resolvers\": totals[\"resolvers\"]},\n            }\n        }\n", "path": "ariadne/contrib/tracing/apollotracing.py"}]}