strawberry-graphql 0.224.1__py3-none-any.whl → 0.225.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- strawberry/aiohttp/handlers/graphql_transport_ws_handler.py +1 -1
- strawberry/aiohttp/handlers/graphql_ws_handler.py +1 -1
- strawberry/aiohttp/views.py +2 -2
- strawberry/annotation.py +1 -1
- strawberry/arguments.py +1 -1
- strawberry/asgi/__init__.py +1 -1
- strawberry/asgi/handlers/graphql_transport_ws_handler.py +1 -1
- strawberry/asgi/handlers/graphql_ws_handler.py +1 -1
- strawberry/asgi/test/client.py +1 -1
- strawberry/auto.py +5 -5
- strawberry/chalice/views.py +2 -2
- strawberry/channels/handlers/base.py +1 -1
- strawberry/channels/handlers/graphql_transport_ws_handler.py +1 -1
- strawberry/channels/handlers/graphql_ws_handler.py +1 -1
- strawberry/channels/handlers/http_handler.py +2 -2
- strawberry/channels/handlers/ws_handler.py +1 -1
- strawberry/channels/router.py +1 -1
- strawberry/channels/testing.py +1 -1
- strawberry/codegen/query_codegen.py +2 -2
- strawberry/custom_scalar.py +2 -2
- strawberry/django/__init__.py +3 -1
- strawberry/django/context.py +1 -1
- strawberry/django/views.py +3 -3
- strawberry/exceptions/__init__.py +12 -12
- strawberry/exceptions/conflicting_arguments.py +1 -1
- strawberry/exceptions/duplicated_type_name.py +1 -1
- strawberry/exceptions/handler.py +1 -1
- strawberry/exceptions/invalid_argument_type.py +1 -1
- strawberry/exceptions/missing_arguments_annotations.py +5 -1
- strawberry/exceptions/missing_field_annotation.py +1 -1
- strawberry/exceptions/missing_return_annotation.py +5 -1
- strawberry/exceptions/not_a_strawberry_enum.py +1 -1
- strawberry/exceptions/object_is_not_a_class.py +1 -1
- strawberry/exceptions/object_is_not_an_enum.py +1 -1
- strawberry/exceptions/permission_fail_silently_requires_optional.py +1 -1
- strawberry/exceptions/private_strawberry_field.py +1 -1
- strawberry/exceptions/scalar_already_registered.py +1 -1
- strawberry/exceptions/unresolved_field_type.py +1 -1
- strawberry/experimental/pydantic/_compat.py +1 -1
- strawberry/experimental/pydantic/conversion_types.py +1 -1
- strawberry/experimental/pydantic/exceptions.py +9 -4
- strawberry/ext/mypy_plugin.py +1 -1
- strawberry/extensions/__init__.py +2 -1
- strawberry/extensions/add_validation_rules.py +1 -1
- strawberry/extensions/base_extension.py +1 -1
- strawberry/extensions/context.py +67 -61
- strawberry/extensions/disable_validation.py +1 -1
- strawberry/extensions/mask_errors.py +1 -1
- strawberry/extensions/max_aliases.py +2 -2
- strawberry/extensions/max_tokens.py +1 -1
- strawberry/extensions/parser_cache.py +1 -1
- strawberry/extensions/query_depth_limiter.py +2 -2
- strawberry/extensions/runner.py +1 -1
- strawberry/extensions/tracing/__init__.py +2 -2
- strawberry/extensions/tracing/apollo.py +1 -1
- strawberry/extensions/tracing/datadog.py +2 -2
- strawberry/extensions/tracing/opentelemetry.py +1 -1
- strawberry/extensions/tracing/sentry.py +2 -2
- strawberry/extensions/validation_cache.py +1 -1
- strawberry/fastapi/router.py +47 -5
- strawberry/federation/schema.py +1 -1
- strawberry/federation/schema_directives.py +1 -1
- strawberry/field.py +2 -2
- strawberry/flask/views.py +3 -3
- strawberry/http/exceptions.py +1 -1
- strawberry/lazy_type.py +16 -3
- strawberry/litestar/controller.py +2 -2
- strawberry/litestar/handlers/graphql_transport_ws_handler.py +1 -1
- strawberry/litestar/handlers/graphql_ws_handler.py +1 -1
- strawberry/object_type.py +3 -3
- strawberry/permission.py +1 -1
- strawberry/quart/views.py +2 -2
- strawberry/relay/exceptions.py +3 -3
- strawberry/relay/types.py +2 -2
- strawberry/sanic/views.py +2 -2
- strawberry/schema/config.py +1 -1
- strawberry/schema/exceptions.py +1 -1
- strawberry/schema/schema.py +1 -1
- strawberry/schema/schema_converter.py +7 -2
- strawberry/schema_codegen/__init__.py +2 -2
- strawberry/starlite/controller.py +6 -6
- strawberry/starlite/handlers/graphql_transport_ws_handler.py +1 -1
- strawberry/starlite/handlers/graphql_ws_handler.py +1 -1
- strawberry/subscriptions/protocols/graphql_transport_ws/handlers.py +14 -4
- strawberry/subscriptions/protocols/graphql_ws/handlers.py +1 -1
- strawberry/test/client.py +6 -2
- strawberry/type.py +3 -3
- strawberry/types/execution.py +1 -1
- strawberry/types/fields/resolver.py +3 -3
- strawberry/types/types.py +1 -1
- strawberry/union.py +2 -2
- strawberry/unset.py +2 -2
- {strawberry_graphql-0.224.1.dist-info → strawberry_graphql-0.225.0.dist-info}/METADATA +1 -1
- {strawberry_graphql-0.224.1.dist-info → strawberry_graphql-0.225.0.dist-info}/RECORD +97 -97
- {strawberry_graphql-0.224.1.dist-info → strawberry_graphql-0.225.0.dist-info}/LICENSE +0 -0
- {strawberry_graphql-0.224.1.dist-info → strawberry_graphql-0.225.0.dist-info}/WHEEL +0 -0
- {strawberry_graphql-0.224.1.dist-info → strawberry_graphql-0.225.0.dist-info}/entry_points.txt +0 -0
@@ -20,7 +20,7 @@ class GraphQLWSHandler(BaseGraphQLWSHandler):
|
|
20
20
|
get_context: Callable,
|
21
21
|
get_root_value: Callable,
|
22
22
|
ws: WebSocket,
|
23
|
-
):
|
23
|
+
) -> None:
|
24
24
|
super().__init__(schema, debug, keep_alive, keep_alive_interval)
|
25
25
|
self._get_context = get_context
|
26
26
|
self._get_root_value = get_root_value
|
strawberry/object_type.py
CHANGED
@@ -125,7 +125,7 @@ def _wrap_dataclass(cls: Type[Any]):
|
|
125
125
|
|
126
126
|
|
127
127
|
def _process_type(
|
128
|
-
cls:
|
128
|
+
cls: T,
|
129
129
|
*,
|
130
130
|
name: Optional[str] = None,
|
131
131
|
is_input: bool = False,
|
@@ -133,7 +133,7 @@ def _process_type(
|
|
133
133
|
description: Optional[str] = None,
|
134
134
|
directives: Optional[Sequence[object]] = (),
|
135
135
|
extend: bool = False,
|
136
|
-
):
|
136
|
+
) -> T:
|
137
137
|
name = name or to_camel_case(cls.__name__)
|
138
138
|
|
139
139
|
interfaces = _get_interfaces(cls)
|
@@ -237,7 +237,7 @@ def type(
|
|
237
237
|
>>> field_abc: str = "ABC"
|
238
238
|
"""
|
239
239
|
|
240
|
-
def wrap(cls: Type):
|
240
|
+
def wrap(cls: Type) -> T:
|
241
241
|
if not inspect.isclass(cls):
|
242
242
|
if is_input:
|
243
243
|
exc = ObjectIsNotClassError.input
|
strawberry/permission.py
CHANGED
@@ -109,7 +109,7 @@ class PermissionExtension(FieldExtension):
|
|
109
109
|
permissions: List[BasePermission],
|
110
110
|
use_directives: bool = True,
|
111
111
|
fail_silently: bool = False,
|
112
|
-
):
|
112
|
+
) -> None:
|
113
113
|
self.permissions = permissions
|
114
114
|
self.fail_silently = fail_silently
|
115
115
|
self.return_empty_list = False
|
strawberry/quart/views.py
CHANGED
@@ -17,7 +17,7 @@ if TYPE_CHECKING:
|
|
17
17
|
|
18
18
|
|
19
19
|
class QuartHTTPRequestAdapter(AsyncHTTPRequestAdapter):
|
20
|
-
def __init__(self, request: Request):
|
20
|
+
def __init__(self, request: Request) -> None:
|
21
21
|
self.request = request
|
22
22
|
|
23
23
|
@property
|
@@ -61,7 +61,7 @@ class GraphQLView(
|
|
61
61
|
graphiql: Optional[bool] = None,
|
62
62
|
graphql_ide: Optional[GraphQL_IDE] = "graphiql",
|
63
63
|
allow_queries_via_get: bool = True,
|
64
|
-
):
|
64
|
+
) -> None:
|
65
65
|
self.schema = schema
|
66
66
|
self.allow_queries_via_get = allow_queries_via_get
|
67
67
|
|
strawberry/relay/exceptions.py
CHANGED
@@ -13,7 +13,7 @@ if TYPE_CHECKING:
|
|
13
13
|
|
14
14
|
|
15
15
|
class NodeIDAnnotationError(StrawberryException):
|
16
|
-
def __init__(self, message: str, cls: Type):
|
16
|
+
def __init__(self, message: str, cls: Type) -> None:
|
17
17
|
self.cls = cls
|
18
18
|
|
19
19
|
self.message = message
|
@@ -41,7 +41,7 @@ class NodeIDAnnotationError(StrawberryException):
|
|
41
41
|
|
42
42
|
|
43
43
|
class RelayWrongAnnotationError(StrawberryException):
|
44
|
-
def __init__(self, field_name: str, cls: Type):
|
44
|
+
def __init__(self, field_name: str, cls: Type) -> None:
|
45
45
|
self.cls = cls
|
46
46
|
self.field_name = field_name
|
47
47
|
|
@@ -71,7 +71,7 @@ class RelayWrongAnnotationError(StrawberryException):
|
|
71
71
|
|
72
72
|
|
73
73
|
class RelayWrongResolverAnnotationError(StrawberryException):
|
74
|
-
def __init__(self, field_name: str, resolver: StrawberryResolver):
|
74
|
+
def __init__(self, field_name: str, resolver: StrawberryResolver) -> None:
|
75
75
|
self.function = resolver.wrapped_func
|
76
76
|
self.field_name = field_name
|
77
77
|
|
strawberry/relay/types.py
CHANGED
@@ -86,7 +86,7 @@ class GlobalID:
|
|
86
86
|
type_name: str
|
87
87
|
node_id: str
|
88
88
|
|
89
|
-
def __post_init__(self):
|
89
|
+
def __post_init__(self) -> None:
|
90
90
|
if not isinstance(self.type_name, str):
|
91
91
|
raise GlobalIDValueError(
|
92
92
|
f"type_name is expected to be a string, found {self.type_name!r}"
|
@@ -96,7 +96,7 @@ class GlobalID:
|
|
96
96
|
f"node_id is expected to be a string, found {self.node_id!r}"
|
97
97
|
)
|
98
98
|
|
99
|
-
def __str__(self):
|
99
|
+
def __str__(self) -> str:
|
100
100
|
return to_base64(self.type_name, self.node_id)
|
101
101
|
|
102
102
|
@classmethod
|
strawberry/sanic/views.py
CHANGED
@@ -33,7 +33,7 @@ if TYPE_CHECKING:
|
|
33
33
|
|
34
34
|
|
35
35
|
class SanicHTTPRequestAdapter(AsyncHTTPRequestAdapter):
|
36
|
-
def __init__(self, request: Request):
|
36
|
+
def __init__(self, request: Request) -> None:
|
37
37
|
self.request = request
|
38
38
|
|
39
39
|
@property
|
@@ -107,7 +107,7 @@ class GraphQLView(
|
|
107
107
|
allow_queries_via_get: bool = True,
|
108
108
|
json_encoder: Optional[Type[json.JSONEncoder]] = None,
|
109
109
|
json_dumps_params: Optional[Dict[str, Any]] = None,
|
110
|
-
):
|
110
|
+
) -> None:
|
111
111
|
self.schema = schema
|
112
112
|
self.allow_queries_via_get = allow_queries_via_get
|
113
113
|
self.json_encoder = json_encoder
|
strawberry/schema/config.py
CHANGED
strawberry/schema/exceptions.py
CHANGED
@@ -2,7 +2,7 @@ from strawberry.types.graphql import OperationType
|
|
2
2
|
|
3
3
|
|
4
4
|
class InvalidOperationTypeError(Exception):
|
5
|
-
def __init__(self, operation_type: OperationType):
|
5
|
+
def __init__(self, operation_type: OperationType) -> None:
|
6
6
|
self.operation_type = operation_type
|
7
7
|
|
8
8
|
def as_http_error_reason(self, method: str) -> str:
|
strawberry/schema/schema.py
CHANGED
@@ -146,7 +146,12 @@ def _get_thunk_mapping(
|
|
146
146
|
# subclass the GraphQLEnumType class to enable returning Enum members from
|
147
147
|
# resolvers.
|
148
148
|
class CustomGraphQLEnumType(GraphQLEnumType):
|
149
|
-
def __init__(
|
149
|
+
def __init__(
|
150
|
+
self,
|
151
|
+
enum: EnumDefinition,
|
152
|
+
*args: Any,
|
153
|
+
**kwargs: Any,
|
154
|
+
) -> None:
|
150
155
|
super().__init__(*args, **kwargs)
|
151
156
|
self.wrapped_cls = enum.wrapped_cls
|
152
157
|
|
@@ -182,7 +187,7 @@ class GraphQLCoreConverter:
|
|
182
187
|
config: StrawberryConfig,
|
183
188
|
scalar_registry: Dict[object, Union[ScalarWrapper, ScalarDefinition]],
|
184
189
|
get_fields: Callable[[StrawberryObjectDefinition], List[StrawberryField]],
|
185
|
-
):
|
190
|
+
) -> None:
|
186
191
|
self.type_map: Dict[str, ConcreteType] = {}
|
187
192
|
self.config = config
|
188
193
|
self.scalar_registry = scalar_registry
|
@@ -311,7 +311,7 @@ def _get_federation_arguments(
|
|
311
311
|
argument_name: str,
|
312
312
|
keyword_name: str | None = None,
|
313
313
|
flatten: bool = True,
|
314
|
-
):
|
314
|
+
) -> None:
|
315
315
|
keyword_name = keyword_name or directive
|
316
316
|
|
317
317
|
if directive in directives:
|
@@ -507,7 +507,7 @@ def _get_schema_definition(
|
|
507
507
|
|
508
508
|
args: list[cst.Arg] = []
|
509
509
|
|
510
|
-
def _get_arg(name: str, value: str):
|
510
|
+
def _get_arg(name: str, value: str) -> cst.Arg:
|
511
511
|
return cst.Arg(
|
512
512
|
keyword=cst.Name(name),
|
513
513
|
value=cst.Name(value),
|
@@ -119,7 +119,7 @@ class GraphQLTransportWSHandler(BaseGraphQLTransportWSHandler):
|
|
119
119
|
|
120
120
|
|
121
121
|
class StarliteRequestAdapter(AsyncHTTPRequestAdapter):
|
122
|
-
def __init__(self, request: Request[Any, Any]):
|
122
|
+
def __init__(self, request: Request[Any, Any]) -> None:
|
123
123
|
self.request = request
|
124
124
|
|
125
125
|
@property
|
@@ -148,7 +148,7 @@ class StarliteRequestAdapter(AsyncHTTPRequestAdapter):
|
|
148
148
|
|
149
149
|
|
150
150
|
class BaseContext:
|
151
|
-
def __init__(self):
|
151
|
+
def __init__(self) -> None:
|
152
152
|
self.request: Optional[Union[Request, WebSocket]] = None
|
153
153
|
self.response: Optional[Response] = None
|
154
154
|
|
@@ -176,7 +176,7 @@ def make_graphql_controller(
|
|
176
176
|
|
177
177
|
if context_getter is None:
|
178
178
|
|
179
|
-
def custom_context_getter_():
|
179
|
+
def custom_context_getter_() -> None:
|
180
180
|
return None
|
181
181
|
|
182
182
|
else:
|
@@ -184,7 +184,7 @@ def make_graphql_controller(
|
|
184
184
|
|
185
185
|
if root_value_getter is None:
|
186
186
|
|
187
|
-
def root_value_getter_():
|
187
|
+
def root_value_getter_() -> None:
|
188
188
|
return None
|
189
189
|
|
190
190
|
else:
|
@@ -331,10 +331,10 @@ def make_graphql_controller(
|
|
331
331
|
context: CustomContext,
|
332
332
|
root_value: Any,
|
333
333
|
) -> None:
|
334
|
-
async def _get_context():
|
334
|
+
async def _get_context() -> CustomContext:
|
335
335
|
return context
|
336
336
|
|
337
|
-
async def _get_root_value():
|
337
|
+
async def _get_root_value() -> Any:
|
338
338
|
return root_value
|
339
339
|
|
340
340
|
preferred_protocol = self.pick_preferred_protocol(socket)
|
@@ -19,7 +19,7 @@ class GraphQLTransportWSHandler(BaseGraphQLTransportWSHandler):
|
|
19
19
|
get_context: Callable,
|
20
20
|
get_root_value: Callable,
|
21
21
|
ws: WebSocket,
|
22
|
-
):
|
22
|
+
) -> None:
|
23
23
|
super().__init__(schema, debug, connection_init_wait_timeout)
|
24
24
|
self._get_context = get_context
|
25
25
|
self._get_root_value = get_root_value
|
@@ -19,7 +19,7 @@ class GraphQLWSHandler(BaseGraphQLWSHandler):
|
|
19
19
|
get_context: Callable,
|
20
20
|
get_root_value: Callable,
|
21
21
|
ws: WebSocket,
|
22
|
-
):
|
22
|
+
) -> None:
|
23
23
|
super().__init__(schema, debug, keep_alive, keep_alive_interval)
|
24
24
|
self._get_context = get_context
|
25
25
|
self._get_root_value = get_root_value
|
@@ -4,7 +4,16 @@ import asyncio
|
|
4
4
|
import logging
|
5
5
|
from abc import ABC, abstractmethod
|
6
6
|
from contextlib import suppress
|
7
|
-
from typing import
|
7
|
+
from typing import (
|
8
|
+
TYPE_CHECKING,
|
9
|
+
Any,
|
10
|
+
AsyncGenerator,
|
11
|
+
AsyncIterator,
|
12
|
+
Callable,
|
13
|
+
Dict,
|
14
|
+
List,
|
15
|
+
Optional,
|
16
|
+
)
|
8
17
|
|
9
18
|
from graphql import ExecutionResult as GraphQLExecutionResult
|
10
19
|
from graphql import GraphQLError, GraphQLSyntaxError, parse
|
@@ -32,6 +41,7 @@ if TYPE_CHECKING:
|
|
32
41
|
from strawberry.subscriptions.protocols.graphql_transport_ws.types import (
|
33
42
|
GraphQLTransportMessage,
|
34
43
|
)
|
44
|
+
from strawberry.types import ExecutionResult
|
35
45
|
|
36
46
|
|
37
47
|
class BaseGraphQLTransportWSHandler(ABC):
|
@@ -42,7 +52,7 @@ class BaseGraphQLTransportWSHandler(ABC):
|
|
42
52
|
schema: BaseSchema,
|
43
53
|
debug: bool,
|
44
54
|
connection_init_wait_timeout: timedelta,
|
45
|
-
):
|
55
|
+
) -> None:
|
46
56
|
self.schema = schema
|
47
57
|
self.debug = debug
|
48
58
|
self.connection_init_wait_timeout = connection_init_wait_timeout
|
@@ -245,7 +255,7 @@ class BaseGraphQLTransportWSHandler(ABC):
|
|
245
255
|
)
|
246
256
|
else:
|
247
257
|
# create AsyncGenerator returning a single result
|
248
|
-
async def get_result_source():
|
258
|
+
async def get_result_source() -> AsyncIterator[ExecutionResult]:
|
249
259
|
yield await self.schema.execute(
|
250
260
|
query=message.payload.query,
|
251
261
|
variable_values=message.payload.variables,
|
@@ -383,7 +393,7 @@ class Operation:
|
|
383
393
|
handler: BaseGraphQLTransportWSHandler,
|
384
394
|
id: str,
|
385
395
|
operation_type: OperationType,
|
386
|
-
):
|
396
|
+
) -> None:
|
387
397
|
self.handler = handler
|
388
398
|
self.id = id
|
389
399
|
self.operation_type = operation_type
|
strawberry/test/client.py
CHANGED
@@ -23,7 +23,11 @@ class Body(TypedDict, total=False):
|
|
23
23
|
|
24
24
|
|
25
25
|
class BaseGraphQLTestClient(ABC):
|
26
|
-
def __init__(
|
26
|
+
def __init__(
|
27
|
+
self,
|
28
|
+
client: Any,
|
29
|
+
url: str = "/graphql/",
|
30
|
+
) -> None:
|
27
31
|
self._client = client
|
28
32
|
self.url = url
|
29
33
|
|
@@ -159,7 +163,7 @@ class BaseGraphQLTestClient(ABC):
|
|
159
163
|
map_without_vars = {k: v for k, v in map.items() if k in files}
|
160
164
|
return map_without_vars
|
161
165
|
|
162
|
-
def _decode(self, response: Any, type: Literal["multipart", "json"]):
|
166
|
+
def _decode(self, response: Any, type: Literal["multipart", "json"]) -> Any:
|
163
167
|
if type == "multipart":
|
164
168
|
return json.loads(response.content.decode())
|
165
169
|
return response.json()
|
strawberry/type.py
CHANGED
@@ -80,7 +80,7 @@ class StrawberryType(ABC):
|
|
80
80
|
class StrawberryContainer(StrawberryType):
|
81
81
|
def __init__(
|
82
82
|
self, of_type: Union[StrawberryType, Type[WithStrawberryObjectDefinition], type]
|
83
|
-
):
|
83
|
+
) -> None:
|
84
84
|
self.of_type = of_type
|
85
85
|
|
86
86
|
def __hash__(self) -> int:
|
@@ -152,7 +152,7 @@ class StrawberryOptional(StrawberryContainer):
|
|
152
152
|
|
153
153
|
|
154
154
|
class StrawberryTypeVar(StrawberryType):
|
155
|
-
def __init__(self, type_var: TypeVar):
|
155
|
+
def __init__(self, type_var: TypeVar) -> None:
|
156
156
|
self.type_var = type_var
|
157
157
|
|
158
158
|
def copy_with(
|
@@ -179,7 +179,7 @@ class StrawberryTypeVar(StrawberryType):
|
|
179
179
|
|
180
180
|
return super().__eq__(other)
|
181
181
|
|
182
|
-
def __hash__(self):
|
182
|
+
def __hash__(self) -> int:
|
183
183
|
return hash(self.type_var)
|
184
184
|
|
185
185
|
|
strawberry/types/execution.py
CHANGED
@@ -52,7 +52,7 @@ class ExecutionContext:
|
|
52
52
|
errors: Optional[List[GraphQLError]] = None
|
53
53
|
result: Optional[GraphQLExecutionResult] = None
|
54
54
|
|
55
|
-
def __post_init__(self, provided_operation_name: str | None):
|
55
|
+
def __post_init__(self, provided_operation_name: str | None) -> None:
|
56
56
|
self._provided_operation_name = provided_operation_name
|
57
57
|
|
58
58
|
@property
|
@@ -38,7 +38,7 @@ if TYPE_CHECKING:
|
|
38
38
|
|
39
39
|
|
40
40
|
class Parameter(inspect.Parameter):
|
41
|
-
def __hash__(self):
|
41
|
+
def __hash__(self) -> int:
|
42
42
|
"""Override to exclude default value from hash.
|
43
43
|
|
44
44
|
This adds compatibility for using unhashable default values in resolvers such as
|
@@ -187,7 +187,7 @@ class StrawberryResolver(Generic[T]):
|
|
187
187
|
*,
|
188
188
|
description: Optional[str] = None,
|
189
189
|
type_override: Optional[Union[StrawberryType, type]] = None,
|
190
|
-
):
|
190
|
+
) -> None:
|
191
191
|
self.wrapped_func = func
|
192
192
|
self._description = description
|
193
193
|
self._type_override = type_override
|
@@ -396,7 +396,7 @@ class StrawberryResolver(Generic[T]):
|
|
396
396
|
|
397
397
|
|
398
398
|
class UncallableResolverError(Exception):
|
399
|
-
def __init__(self, resolver: StrawberryResolver):
|
399
|
+
def __init__(self, resolver: StrawberryResolver) -> None:
|
400
400
|
message = (
|
401
401
|
f"Attempted to call resolver {resolver} with uncallable function "
|
402
402
|
f"{resolver.wrapped_func}"
|
strawberry/types/types.py
CHANGED
@@ -61,7 +61,7 @@ class StrawberryObjectDefinition(StrawberryType):
|
|
61
61
|
default_factory=dict
|
62
62
|
)
|
63
63
|
|
64
|
-
def __post_init__(self):
|
64
|
+
def __post_init__(self) -> None:
|
65
65
|
# resolve `Self` annotation with the origin type
|
66
66
|
for index, field in enumerate(self.fields):
|
67
67
|
if isinstance(field.type, StrawberryType) and field.type.has_generic(Self): # type: ignore
|
strawberry/union.py
CHANGED
@@ -60,7 +60,7 @@ class StrawberryUnion(StrawberryType):
|
|
60
60
|
type_annotations: Tuple[StrawberryAnnotation, ...] = tuple(),
|
61
61
|
description: Optional[str] = None,
|
62
62
|
directives: Iterable[object] = (),
|
63
|
-
):
|
63
|
+
) -> None:
|
64
64
|
self.graphql_name = name
|
65
65
|
self.type_annotations = type_annotations
|
66
66
|
self.description = description
|
@@ -102,7 +102,7 @@ class StrawberryUnion(StrawberryType):
|
|
102
102
|
|
103
103
|
@property
|
104
104
|
def type_params(self) -> List[TypeVar]:
|
105
|
-
def _get_type_params(type_: StrawberryType):
|
105
|
+
def _get_type_params(type_: StrawberryType) -> list[TypeVar]:
|
106
106
|
if isinstance(type_, LazyType):
|
107
107
|
type_ = cast("StrawberryType", type_.resolve_type())
|
108
108
|
|
strawberry/unset.py
CHANGED
@@ -17,13 +17,13 @@ class UnsetType:
|
|
17
17
|
else:
|
18
18
|
return cls.__instance
|
19
19
|
|
20
|
-
def __str__(self):
|
20
|
+
def __str__(self) -> str:
|
21
21
|
return ""
|
22
22
|
|
23
23
|
def __repr__(self) -> str:
|
24
24
|
return "UNSET"
|
25
25
|
|
26
|
-
def __bool__(self):
|
26
|
+
def __bool__(self) -> bool:
|
27
27
|
return False
|
28
28
|
|
29
29
|
|