strawberry-graphql 0.236.1__py3-none-any.whl → 0.236.2__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/federation/schema.py +14 -19
- strawberry/printer/printer.py +1 -1
- strawberry/relay/fields.py +1 -1
- strawberry/relay/types.py +1 -1
- strawberry/schema/execute.py +1 -7
- strawberry/types/lazy_type.py +1 -1
- strawberry/utils/await_maybe.py +2 -2
- strawberry/utils/typing.py +1 -1
- {strawberry_graphql-0.236.1.dist-info → strawberry_graphql-0.236.2.dist-info}/METADATA +1 -1
- {strawberry_graphql-0.236.1.dist-info → strawberry_graphql-0.236.2.dist-info}/RECORD +13 -13
- {strawberry_graphql-0.236.1.dist-info → strawberry_graphql-0.236.2.dist-info}/LICENSE +0 -0
- {strawberry_graphql-0.236.1.dist-info → strawberry_graphql-0.236.2.dist-info}/WHEEL +0 -0
- {strawberry_graphql-0.236.1.dist-info → strawberry_graphql-0.236.2.dist-info}/entry_points.txt +0 -0
strawberry/federation/schema.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
from collections import defaultdict
|
2
|
-
from functools import cached_property
|
2
|
+
from functools import cached_property
|
3
3
|
from itertools import chain
|
4
4
|
from typing import (
|
5
5
|
TYPE_CHECKING,
|
@@ -17,8 +17,6 @@ from typing import (
|
|
17
17
|
cast,
|
18
18
|
)
|
19
19
|
|
20
|
-
from graphql import GraphQLError
|
21
|
-
|
22
20
|
from strawberry.annotation import StrawberryAnnotation
|
23
21
|
from strawberry.printer import print_schema
|
24
22
|
from strawberry.schema import Schema as BaseSchema
|
@@ -178,28 +176,25 @@ class Schema(BaseSchema):
|
|
178
176
|
if "info" in func_args:
|
179
177
|
kwargs["info"] = info
|
180
178
|
|
181
|
-
|
179
|
+
try:
|
180
|
+
result = resolve_reference(**kwargs)
|
181
|
+
except Exception as e:
|
182
|
+
result = e
|
182
183
|
else:
|
183
184
|
from strawberry.types.arguments import convert_argument
|
184
185
|
|
185
186
|
config = info.schema.config
|
186
187
|
scalar_registry = info.schema.schema_converter.scalar_registry
|
187
188
|
|
188
|
-
|
189
|
-
convert_argument
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
result = get_result()
|
198
|
-
except Exception as e:
|
199
|
-
result = GraphQLError(
|
200
|
-
f"Unable to resolve reference for {definition.origin}",
|
201
|
-
original_error=e,
|
202
|
-
)
|
189
|
+
try:
|
190
|
+
result = convert_argument(
|
191
|
+
representation,
|
192
|
+
type_=definition.origin,
|
193
|
+
scalar_registry=scalar_registry,
|
194
|
+
config=config,
|
195
|
+
)
|
196
|
+
except Exception:
|
197
|
+
result = TypeError(f"Unable to resolve reference for {type_name}")
|
203
198
|
|
204
199
|
results.append(result)
|
205
200
|
|
strawberry/printer/printer.py
CHANGED
@@ -84,7 +84,7 @@ def _serialize_dataclasses(value: object) -> object: ...
|
|
84
84
|
|
85
85
|
def _serialize_dataclasses(value):
|
86
86
|
if dataclasses.is_dataclass(value):
|
87
|
-
return dataclasses.asdict(value)
|
87
|
+
return dataclasses.asdict(value) # type: ignore
|
88
88
|
if isinstance(value, (list, tuple)):
|
89
89
|
return [_serialize_dataclasses(v) for v in value]
|
90
90
|
if isinstance(value, dict):
|
strawberry/relay/fields.py
CHANGED
strawberry/relay/types.py
CHANGED
strawberry/schema/execute.py
CHANGED
@@ -4,7 +4,6 @@ from asyncio import ensure_future
|
|
4
4
|
from inspect import isawaitable
|
5
5
|
from typing import (
|
6
6
|
TYPE_CHECKING,
|
7
|
-
Awaitable,
|
8
7
|
Callable,
|
9
8
|
Iterable,
|
10
9
|
List,
|
@@ -14,7 +13,6 @@ from typing import (
|
|
14
13
|
Type,
|
15
14
|
TypedDict,
|
16
15
|
Union,
|
17
|
-
cast,
|
18
16
|
)
|
19
17
|
|
20
18
|
from graphql import GraphQLError, parse
|
@@ -32,7 +30,6 @@ if TYPE_CHECKING:
|
|
32
30
|
from typing_extensions import NotRequired, Unpack
|
33
31
|
|
34
32
|
from graphql import ExecutionContext as GraphQLExecutionContext
|
35
|
-
from graphql import ExecutionResult as GraphQLExecutionResult
|
36
33
|
from graphql import GraphQLSchema
|
37
34
|
from graphql.language import DocumentNode
|
38
35
|
from graphql.validation import ASTValidationRule
|
@@ -139,9 +136,8 @@ async def execute(
|
|
139
136
|
)
|
140
137
|
|
141
138
|
if isawaitable(result):
|
142
|
-
result = await
|
139
|
+
result = await result
|
143
140
|
|
144
|
-
result = cast("GraphQLExecutionResult", result)
|
145
141
|
execution_context.result = result
|
146
142
|
# Also set errors on the execution_context so that it's easier
|
147
143
|
# to access in extensions
|
@@ -237,13 +233,11 @@ def execute_sync(
|
|
237
233
|
)
|
238
234
|
|
239
235
|
if isawaitable(result):
|
240
|
-
result = cast(Awaitable["GraphQLExecutionResult"], result)
|
241
236
|
ensure_future(result).cancel()
|
242
237
|
raise RuntimeError(
|
243
238
|
"GraphQL execution failed to complete synchronously."
|
244
239
|
)
|
245
240
|
|
246
|
-
result = cast("GraphQLExecutionResult", result)
|
247
241
|
execution_context.result = result
|
248
242
|
# Also set errors on the execution_context so that it's easier
|
249
243
|
# to access in extensions
|
strawberry/types/lazy_type.py
CHANGED
@@ -58,7 +58,7 @@ class LazyType(Generic[TypeName, Module]):
|
|
58
58
|
|
59
59
|
return cls(type_name, module, package)
|
60
60
|
|
61
|
-
def __or__(self, other: Other) ->
|
61
|
+
def __or__(self, other: Other) -> object:
|
62
62
|
return Union[self, other]
|
63
63
|
|
64
64
|
def resolve_type(self) -> Type[Any]:
|
strawberry/utils/await_maybe.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import inspect
|
2
|
-
from typing import AsyncIterator, Awaitable, Iterator, TypeVar, Union
|
2
|
+
from typing import AsyncIterator, Awaitable, Iterator, TypeVar, Union
|
3
3
|
|
4
4
|
T = TypeVar("T")
|
5
5
|
|
@@ -11,7 +11,7 @@ async def await_maybe(value: AwaitableOrValue[T]) -> T:
|
|
11
11
|
if inspect.isawaitable(value):
|
12
12
|
return await value
|
13
13
|
|
14
|
-
return
|
14
|
+
return value
|
15
15
|
|
16
16
|
|
17
17
|
__all__ = ["await_maybe", "AwaitableOrValue", "AsyncIteratorOrIterator"]
|
strawberry/utils/typing.py
CHANGED
@@ -239,7 +239,7 @@ def _ast_replace_union_operation(
|
|
239
239
|
expr = ast.Subscript(
|
240
240
|
expr.value,
|
241
241
|
# The cast is required for mypy on python 3.7 and 3.8
|
242
|
-
ast.Index(_ast_replace_union_operation(cast(Any, expr.slice).value)),
|
242
|
+
ast.Index(_ast_replace_union_operation(cast(Any, expr.slice).value)), # type: ignore
|
243
243
|
ast.Load(),
|
244
244
|
)
|
245
245
|
elif isinstance(expr.slice, (ast.BinOp, ast.Tuple)):
|
@@ -131,7 +131,7 @@ strawberry/federation/field.py,sha256=u7J2f2QAwzkgYx9S3oxCy9b2LduC6pglyUUHbVkk-X
|
|
131
131
|
strawberry/federation/mutation.py,sha256=5t2E419m4K2W6LoWEOzWgMdL2J0PwHnsffYkpChqqDQ,67
|
132
132
|
strawberry/federation/object_type.py,sha256=vrf7KC9p_UNV4hXIVDjZeUjx9xzfH3BF6ZYdlUEQW50,9357
|
133
133
|
strawberry/federation/scalar.py,sha256=c1FI3uPxbSM4wj88TaXsBK5t2w6S-rypzojcSNC-pnQ,4636
|
134
|
-
strawberry/federation/schema.py,sha256=
|
134
|
+
strawberry/federation/schema.py,sha256=Dsy__upYMu3za6oNssMt9hz5uaEufI_yUtprLFDJRPw,13235
|
135
135
|
strawberry/federation/schema_directive.py,sha256=GxmwapBQq80ZOjA4v_xhogHU3eV3N-ZiTRJOXffltbg,1751
|
136
136
|
strawberry/federation/schema_directives.py,sha256=aIJ1zpASClF6ujLCUWmNuSR1ccX3pyvBTK501DUh-5Q,6400
|
137
137
|
strawberry/federation/types.py,sha256=cqyx_-GJ5d__hac7bip_dQKm9NGR88D0N1JVnde0Ji8,360
|
@@ -161,14 +161,14 @@ strawberry/parent.py,sha256=sXURm0lauSpjUADsmfNGY-Zl7kHs0A67BFcWuWKzRxw,771
|
|
161
161
|
strawberry/permission.py,sha256=NsYq-c4AgDCDBsYXsJN94yWJjuwYkvytpqXE4BIf_vc,7226
|
162
162
|
strawberry/printer/__init__.py,sha256=DmepjmgtkdF5RxK_7yC6qUyRWn56U-9qeZMbkztYB9w,62
|
163
163
|
strawberry/printer/ast_from_value.py,sha256=LgM5g2qvBOnAIf9znbiMEcRX0PGSQohR3Vr3QYfU604,4983
|
164
|
-
strawberry/printer/printer.py,sha256=
|
164
|
+
strawberry/printer/printer.py,sha256=GntTBivg3fb_zPM41Q8DtWMiRmkmM9xwTF-aFWvnqTg,17524
|
165
165
|
strawberry/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
166
166
|
strawberry/quart/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
167
167
|
strawberry/quart/views.py,sha256=5Y7JNv3oi9u__iQx2l2fQvz-Ha1H-ZhhYslaFsNUIs0,3432
|
168
168
|
strawberry/relay/__init__.py,sha256=Vi4btvA_g6Cj9Tk_F9GCSegapIf2WqkOWV8y3P0cTCs,553
|
169
169
|
strawberry/relay/exceptions.py,sha256=KZSRJYlfutrAQALtBPnzJHRIMK6GZSnKAT_H4wIzGcI,4035
|
170
|
-
strawberry/relay/fields.py,sha256=
|
171
|
-
strawberry/relay/types.py,sha256=
|
170
|
+
strawberry/relay/fields.py,sha256=qrpDxDQ_bdzDUKtd8gxo9P3Oermxbux3yjFvHvHC1Ho,16927
|
171
|
+
strawberry/relay/types.py,sha256=m700VJK6-JTQRrxGBk2ZyuXsnB9__RWflQ5iZvpuxcQ,29776
|
172
172
|
strawberry/relay/utils.py,sha256=Vqi4raWdzRkqt7jU_RBMCwXp4h6H-16WJ7la0lugZi0,5692
|
173
173
|
strawberry/resolvers.py,sha256=Vdidc3YFc4-olSQZD_xQ1icyAFbyzqs_8I3eSpMFlA4,260
|
174
174
|
strawberry/sanic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -181,7 +181,7 @@ strawberry/schema/base.py,sha256=eH0nyrCKwdtvgzLS810LMTffpY5CsRd9qY-uZs9pZ3U,364
|
|
181
181
|
strawberry/schema/compat.py,sha256=rRqUm5-XgPXC018_u0Mrd4iad7tTRCNA45Ko4NaT6gk,1836
|
182
182
|
strawberry/schema/config.py,sha256=Aa01oqnHb0ZPlw8Ti_O840LxlT827LNio15BQrc37A0,717
|
183
183
|
strawberry/schema/exceptions.py,sha256=rqVNb_oYrKM0dHPgvAemqCG6Um282LPPu4zwQ5cZqs4,584
|
184
|
-
strawberry/schema/execute.py,sha256=
|
184
|
+
strawberry/schema/execute.py,sha256=74eGjXrptVO_EP-luZmSHUeXtt3Lk5BbEoZv9v7w0jo,10840
|
185
185
|
strawberry/schema/name_converter.py,sha256=tpqw2XCSFvJI-H844iWhE2Z1sKic7DrjIZxt11eJN5Y,6574
|
186
186
|
strawberry/schema/schema.py,sha256=0zZirswxx5_lryhDTzXpjyDOnjfWuOvWHxkM9ZTyYF4,15789
|
187
187
|
strawberry/schema/schema_converter.py,sha256=lckL2LoxAb6mNfJIVcerht2buzBG573ly3BHyl7wra4,36859
|
@@ -226,7 +226,7 @@ strawberry/types/fields/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
|
|
226
226
|
strawberry/types/fields/resolver.py,sha256=EoNFUbz_cV6QH_jHi5uMtgd5EnE_fnvbJPTWeNpYL6M,13992
|
227
227
|
strawberry/types/graphql.py,sha256=Hnt7RplzBdcthNYxYB4PA3LqffG99ICQSgSrDa28bJQ,717
|
228
228
|
strawberry/types/info.py,sha256=Y5nVRPJBwKaqT8CtSrMGpWdsgT_eW88dJXNwMAKNG0k,4750
|
229
|
-
strawberry/types/lazy_type.py,sha256=
|
229
|
+
strawberry/types/lazy_type.py,sha256=sDQZYR-rEqVhsiBsnyY7y2qcC21luJgtJqrc0MbsnQM,5098
|
230
230
|
strawberry/types/mutation.py,sha256=bS2WotWenRP-lKJazPIvuzpD4sfS3Rp5leq7-DPNS_I,11975
|
231
231
|
strawberry/types/nodes.py,sha256=TVQ4TWeJEK2vdtlQMXMjD8tb57PkuONhne4Orgzaf90,5114
|
232
232
|
strawberry/types/object_type.py,sha256=-LvRnigI5iK9SgfH82b7eLzXw6DswM2ad6ZVOBUU_sE,14952
|
@@ -237,7 +237,7 @@ strawberry/types/union.py,sha256=sMCatme1HM1VJRc3i2y0sQqtqxvpLotL-669hu06EMc,100
|
|
237
237
|
strawberry/types/unset.py,sha256=s2l9DCWesItiC-NtT3InLFrD1XeIOBxXZKahigQ11wQ,1712
|
238
238
|
strawberry/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
239
239
|
strawberry/utils/aio.py,sha256=8n4mrAHjx12zp1phqNv1mXx2-1mQRXLNRbpNMS2MDoM,1706
|
240
|
-
strawberry/utils/await_maybe.py,sha256=
|
240
|
+
strawberry/utils/await_maybe.py,sha256=7KMNa8DSjzQP1XbPyEIbFMokAbKxs_6AlTKWseJOwNw,422
|
241
241
|
strawberry/utils/dataclasses.py,sha256=1wvVq0vgvjrRSamJ3CBJpkLu1KVweTmw5JLXmagdGes,856
|
242
242
|
strawberry/utils/debug.py,sha256=U4oxSO_gUV8IiH2RG8u3SeHJXGF6ztvXdMa_yZkly1c,1430
|
243
243
|
strawberry/utils/deprecations.py,sha256=_1sxRhFYlaHeEEqK4dy0k1IaYXA3_e1GRsO_LqQLtig,774
|
@@ -247,9 +247,9 @@ strawberry/utils/inspect.py,sha256=2WOeK3o8pjVkIH-rP_TaaLDa_AvroKC1WXc0gSE0Suc,3
|
|
247
247
|
strawberry/utils/logging.py,sha256=U1cseHGquN09YFhFmRkiphfASKCyK0HUZREImPgVb0c,746
|
248
248
|
strawberry/utils/operation.py,sha256=SSXxN-vMqdHO6W2OZtip-1z7y4_A-eTVFdhDvhKeLCk,1193
|
249
249
|
strawberry/utils/str_converters.py,sha256=KGd7QH90RevaJjH6SQEkiVVsb8KuhJr_wv5AsI7UzQk,897
|
250
|
-
strawberry/utils/typing.py,sha256=
|
251
|
-
strawberry_graphql-0.236.
|
252
|
-
strawberry_graphql-0.236.
|
253
|
-
strawberry_graphql-0.236.
|
254
|
-
strawberry_graphql-0.236.
|
255
|
-
strawberry_graphql-0.236.
|
250
|
+
strawberry/utils/typing.py,sha256=tUHHX2YTGX417EEQHB6j0B8-p-fg31ZI8csc9SUoq2I,14260
|
251
|
+
strawberry_graphql-0.236.2.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
|
252
|
+
strawberry_graphql-0.236.2.dist-info/METADATA,sha256=FwItEhdLmHf_nC9kB_rc4O95eHbtRIsHj-b4X7OSi5E,7821
|
253
|
+
strawberry_graphql-0.236.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
254
|
+
strawberry_graphql-0.236.2.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
|
255
|
+
strawberry_graphql-0.236.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
{strawberry_graphql-0.236.1.dist-info → strawberry_graphql-0.236.2.dist-info}/entry_points.txt
RENAMED
File without changes
|