|
28 | 28 |
|
29 | 29 | try: |
30 | 30 | from strawberry import Schema |
31 | | - from strawberry.extensions import SchemaExtension # type: ignore |
32 | | - from strawberry.extensions.tracing.utils import should_skip_tracing as strawberry_should_skip_tracing # type: ignore |
33 | | - from strawberry.http import async_base_view, sync_base_view # type: ignore |
| 31 | + from strawberry.extensions import SchemaExtension |
| 32 | + from strawberry.extensions.tracing.utils import ( |
| 33 | + should_skip_tracing as strawberry_should_skip_tracing, |
| 34 | + ) |
| 35 | + from strawberry.http import async_base_view, sync_base_view |
34 | 36 | except ImportError: |
35 | 37 | raise DidNotEnable("strawberry-graphql is not installed") |
36 | 38 |
|
37 | 39 | try: |
38 | | - from strawberry.extensions.tracing import ( # type: ignore |
| 40 | + from strawberry.extensions.tracing import ( |
39 | 41 | SentryTracingExtension as StrawberrySentryAsyncExtension, |
40 | 42 | SentryTracingExtensionSync as StrawberrySentrySyncExtension, |
41 | 43 | ) |
|
47 | 49 |
|
48 | 50 | if TYPE_CHECKING: |
49 | 51 | from typing import Any, Callable, Generator, List, Optional |
50 | | - from graphql import GraphQLError, GraphQLResolveInfo # type: ignore |
| 52 | + from graphql import GraphQLError, GraphQLResolveInfo |
51 | 53 | from strawberry.http import GraphQLHTTPResponse |
52 | | - from strawberry.types import ExecutionContext # type: ignore |
| 54 | + from strawberry.types import ExecutionContext |
53 | 55 | from sentry_sdk._types import Event, EventProcessor |
54 | 56 |
|
55 | 57 |
|
@@ -122,10 +124,10 @@ def _sentry_patched_schema_init(self, *args, **kwargs): |
122 | 124 |
|
123 | 125 | return old_schema_init(self, *args, **kwargs) |
124 | 126 |
|
125 | | - Schema.__init__ = _sentry_patched_schema_init |
| 127 | + Schema.__init__ = _sentry_patched_schema_init # type: ignore[method-assign] |
126 | 128 |
|
127 | 129 |
|
128 | | -class SentryAsyncExtension(SchemaExtension): # type: ignore |
| 130 | +class SentryAsyncExtension(SchemaExtension): |
129 | 131 | def __init__( |
130 | 132 | self, |
131 | 133 | *, |
@@ -326,10 +328,10 @@ def _sentry_patched_handle_errors(self, errors, response_data): |
326 | 328 | ) |
327 | 329 | sentry_sdk.capture_event(event, hint=hint) |
328 | 330 |
|
329 | | - async_base_view.AsyncBaseHTTPView._handle_errors = ( |
| 331 | + async_base_view.AsyncBaseHTTPView._handle_errors = ( # type: ignore[method-assign] |
330 | 332 | _sentry_patched_async_view_handle_errors |
331 | 333 | ) |
332 | | - sync_base_view.SyncBaseHTTPView._handle_errors = ( |
| 334 | + sync_base_view.SyncBaseHTTPView._handle_errors = ( # type: ignore[method-assign] |
333 | 335 | _sentry_patched_sync_view_handle_errors |
334 | 336 | ) |
335 | 337 |
|
|
0 commit comments