strawberry-graphql 0.258.0__py3-none-any.whl → 0.258.1__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/codegen/plugins/python.py +4 -4
- strawberry/codegen/query_codegen.py +6 -6
- strawberry/exceptions/missing_return_annotation.py +1 -1
- strawberry/exceptions/permission_fail_silently_requires_optional.py +1 -1
- strawberry/printer/ast_from_value.py +1 -2
- strawberry/printer/printer.py +1 -1
- strawberry/schema/schema_converter.py +4 -6
- strawberry/schema/types/scalar.py +1 -1
- {strawberry_graphql-0.258.0.dist-info → strawberry_graphql-0.258.1.dist-info}/METADATA +1 -1
- {strawberry_graphql-0.258.0.dist-info → strawberry_graphql-0.258.1.dist-info}/RECORD +13 -13
- {strawberry_graphql-0.258.0.dist-info → strawberry_graphql-0.258.1.dist-info}/LICENSE +0 -0
- {strawberry_graphql-0.258.0.dist-info → strawberry_graphql-0.258.1.dist-info}/WHEEL +0 -0
- {strawberry_graphql-0.258.0.dist-info → strawberry_graphql-0.258.1.dist-info}/entry_points.txt +0 -0
@@ -65,7 +65,7 @@ class PythonPlugin(QueryCodegenPlugin):
|
|
65
65
|
|
66
66
|
def _print_imports(self) -> str:
|
67
67
|
imports = [
|
68
|
-
f
|
68
|
+
f"from {import_} import {', '.join(sorted(types))}"
|
69
69
|
for import_, types in self.imports.items()
|
70
70
|
]
|
71
71
|
|
@@ -187,9 +187,9 @@ class PythonPlugin(QueryCodegenPlugin):
|
|
187
187
|
if type_.name in self.SCALARS_TO_PYTHON_TYPES:
|
188
188
|
return ""
|
189
189
|
|
190
|
-
assert (
|
191
|
-
|
192
|
-
)
|
190
|
+
assert type_.python_type is not None, (
|
191
|
+
f"Scalar type must have a python type: {type_.name}"
|
192
|
+
)
|
193
193
|
|
194
194
|
return f'{type_.name} = NewType("{type_.name}", {type_.python_type.__name__})'
|
195
195
|
|
@@ -347,9 +347,9 @@ class QueryCodegen:
|
|
347
347
|
)
|
348
348
|
for fd in fragment_definitions:
|
349
349
|
query_type = self.schema.get_type_by_name(fd.type_condition.name.value)
|
350
|
-
assert isinstance(
|
351
|
-
|
352
|
-
)
|
350
|
+
assert isinstance(query_type, StrawberryObjectDefinition), (
|
351
|
+
f"{fd.type_condition.name.value!r} is not a type in the graphql schema!"
|
352
|
+
)
|
353
353
|
|
354
354
|
typename = fd.type_condition.name.value
|
355
355
|
graph_ql_object_type_factory = partial(
|
@@ -695,9 +695,9 @@ class QueryCodegen:
|
|
695
695
|
selection.name.value, parent_type_name
|
696
696
|
)
|
697
697
|
|
698
|
-
assert (
|
699
|
-
|
700
|
-
)
|
698
|
+
assert selected_field, (
|
699
|
+
f"Couldn't find {parent_type_name}.{selection.name.value}"
|
700
|
+
)
|
701
701
|
|
702
702
|
selected_field_type, wrapper = self._unwrap_type(selected_field.type)
|
703
703
|
name = capitalize_first(to_camel_case(selection.name.value))
|
@@ -27,7 +27,7 @@ class MissingReturnAnnotationError(StrawberryException):
|
|
27
27
|
"did you forget to add it?"
|
28
28
|
)
|
29
29
|
self.rich_message = (
|
30
|
-
"[bold red]Missing annotation for field
|
30
|
+
f"[bold red]Missing annotation for field `[underline]{resolver.name}[/]`"
|
31
31
|
)
|
32
32
|
|
33
33
|
self.suggestion = (
|
@@ -16,7 +16,7 @@ class PermissionFailSilentlyRequiresOptionalError(StrawberryException):
|
|
16
16
|
def __init__(self, field: StrawberryField) -> None:
|
17
17
|
self.field = field
|
18
18
|
self.message = (
|
19
|
-
"Cannot use fail_silently=True with a non-optional
|
19
|
+
"Cannot use fail_silently=True with a non-optional or non-list field"
|
20
20
|
)
|
21
21
|
self.rich_message = (
|
22
22
|
"fail_silently permissions can only be used with fields of type "
|
@@ -56,8 +56,7 @@ def ast_from_leaf_type(
|
|
56
56
|
return IntValueNode(value=str(serialized))
|
57
57
|
if isinstance(serialized, float) and isfinite(serialized):
|
58
58
|
value = str(serialized)
|
59
|
-
|
60
|
-
value = value[:-2]
|
59
|
+
value = value.removesuffix(".0")
|
61
60
|
return FloatValueNode(value=value)
|
62
61
|
|
63
62
|
if isinstance(serialized, str):
|
strawberry/printer/printer.py
CHANGED
@@ -83,7 +83,7 @@ def _serialize_dataclasses(value: object) -> object: ...
|
|
83
83
|
|
84
84
|
def _serialize_dataclasses(value):
|
85
85
|
if dataclasses.is_dataclass(value):
|
86
|
-
return dataclasses.asdict(value) # type: ignore
|
86
|
+
return {k: v for k, v in dataclasses.asdict(value).items() if v is not UNSET} # type: ignore
|
87
87
|
if isinstance(value, (list, tuple)):
|
88
88
|
return [_serialize_dataclasses(v) for v in value]
|
89
89
|
if isinstance(value, dict):
|
@@ -518,12 +518,10 @@ class GraphQLCoreConverter:
|
|
518
518
|
assert isinstance(graphql_interface, GraphQLInterfaceType) # For mypy
|
519
519
|
return graphql_interface
|
520
520
|
|
521
|
-
def _get_resolve_type() ->
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
]
|
526
|
-
):
|
521
|
+
def _get_resolve_type() -> Callable[
|
522
|
+
[Any, GraphQLResolveInfo, GraphQLAbstractType],
|
523
|
+
Union[Awaitable[Optional[str]], str, None],
|
524
|
+
]:
|
527
525
|
if interface.resolve_type:
|
528
526
|
return interface.resolve_type
|
529
527
|
|
@@ -68,7 +68,7 @@ DEFAULT_SCALAR_REGISTRY: dict[object, ScalarDefinition] = {
|
|
68
68
|
GlobalID,
|
69
69
|
name="GlobalID",
|
70
70
|
description=GraphQLID.description,
|
71
|
-
parse_literal=lambda v, vars=None: GlobalID.from_id(
|
71
|
+
parse_literal=lambda v, vars=None: GlobalID.from_id( # noqa: A006
|
72
72
|
GraphQLID.parse_literal(v, vars)
|
73
73
|
),
|
74
74
|
parse_value=GlobalID.from_id,
|
@@ -35,9 +35,9 @@ strawberry/codegen/__init__.py,sha256=qVfUJXv_2HqZTzi02An2V9auAseT9efi1f5APDG5Dj
|
|
35
35
|
strawberry/codegen/exceptions.py,sha256=x8Wrc3zdmgrvoMtB3U4c-mek7JEP-KGkbGC27kO6caE,365
|
36
36
|
strawberry/codegen/plugins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
37
37
|
strawberry/codegen/plugins/print_operation.py,sha256=PxNPw9gXtqC_upIhgM9I6pmb66g523VMcIaKgLDMuOc,6799
|
38
|
-
strawberry/codegen/plugins/python.py,sha256=
|
38
|
+
strawberry/codegen/plugins/python.py,sha256=GgwxTGd16LPKxGuZBohJYWsarKjWfZY1-aGIA71m9MU,6903
|
39
39
|
strawberry/codegen/plugins/typescript.py,sha256=LFEK2ZLz4tUukkwZvUTXhsi_cVca3ybsLaatsW5JA5g,3865
|
40
|
-
strawberry/codegen/query_codegen.py,sha256=
|
40
|
+
strawberry/codegen/query_codegen.py,sha256=Wy_yMEZc7O3Jq5Et-rM1uUJBBl0-cElaiM2cSM0nHJk,30527
|
41
41
|
strawberry/codegen/types.py,sha256=K5sjzNWDefOzdGtPumXyLuhnlEtd0zZXdPkF15lejk0,4181
|
42
42
|
strawberry/codemods/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
43
43
|
strawberry/codemods/annotated_unions.py,sha256=T0KqJEmoOdOXVCOHI1G6ECvEVL2tzIRBenysrz3EhPQ,5988
|
@@ -61,10 +61,10 @@ strawberry/exceptions/invalid_union_type.py,sha256=zKxDsagrs4_4ATxSHuPBHY6eQO45S
|
|
61
61
|
strawberry/exceptions/missing_arguments_annotations.py,sha256=-WvTDW75Q2EYFrY3qVZJdbSpAk3UNWkXOnFRDgCzVOk,2007
|
62
62
|
strawberry/exceptions/missing_dependencies.py,sha256=YqMdmXJ_9FnEMFYG6hXyb-1km7N7wsldbat__OigdUQ,832
|
63
63
|
strawberry/exceptions/missing_field_annotation.py,sha256=SRN5pC74JjSJ9FnEHMhkR6soVq2NzRR2502yYum29i8,1332
|
64
|
-
strawberry/exceptions/missing_return_annotation.py,sha256=
|
64
|
+
strawberry/exceptions/missing_return_annotation.py,sha256=zklSbOZnLXFBioHEVz_1FjTJ7RmW4uot3YAUS5Op0SM,1402
|
65
65
|
strawberry/exceptions/object_is_not_a_class.py,sha256=pfPdVNbcdkqQanJf9G-NAHy0QR3Bx1hCUg_Kn_25g-0,2008
|
66
66
|
strawberry/exceptions/object_is_not_an_enum.py,sha256=ieDCJhYW63byRyfG2J7vaZD2imx-VEjkVgXhNcZZ6A4,1263
|
67
|
-
strawberry/exceptions/permission_fail_silently_requires_optional.py,sha256=
|
67
|
+
strawberry/exceptions/permission_fail_silently_requires_optional.py,sha256=yRsdJJSXTf-pMboKFkREe8m3vTf3FMnyq9bxs6ibh78,1742
|
68
68
|
strawberry/exceptions/private_strawberry_field.py,sha256=IhsfqUa0o_D78VYywk8Wz40TDyXyMxkZm0I1aW5EmlE,1328
|
69
69
|
strawberry/exceptions/scalar_already_registered.py,sha256=fkShJdwfawbs39Hje1VOTKNQdAIju-_N14P9CVtrbBI,1848
|
70
70
|
strawberry/exceptions/syntax.py,sha256=dGVmOO1MCOkC1sBPmDrD26lddcRkHlobuF7MwKOa-Gk,1740
|
@@ -145,8 +145,8 @@ strawberry/litestar/controller.py,sha256=_XOvDTxBBUNfot-G880NyK0Zf9W8q5ABcxPOCvD
|
|
145
145
|
strawberry/parent.py,sha256=wViSVYl5ADuyy2EGaS98by_iT1ep9xTP2od8NB_EIuw,742
|
146
146
|
strawberry/permission.py,sha256=dSRJMjSCmTlXfvfC24kCSrAk0txTjYKTJ5ZVU5IW91Y,7537
|
147
147
|
strawberry/printer/__init__.py,sha256=DmepjmgtkdF5RxK_7yC6qUyRWn56U-9qeZMbkztYB9w,62
|
148
|
-
strawberry/printer/ast_from_value.py,sha256=
|
149
|
-
strawberry/printer/printer.py,sha256=
|
148
|
+
strawberry/printer/ast_from_value.py,sha256=Tkme60qlykbN2m3dNPNMOe65X-wj6EmcDQwgQv7gUkc,4987
|
149
|
+
strawberry/printer/printer.py,sha256=JSN21OOMeTkUOGjzG8Ox59_lE7rI_UFAwwlNS4KxAl8,18026
|
150
150
|
strawberry/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
151
151
|
strawberry/quart/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
152
152
|
strawberry/quart/views.py,sha256=Xo7n5cu85fUZW-SGKTbZ4e4UuFrQvRb9PkMPjk0uPSM,4431
|
@@ -169,12 +169,12 @@ strawberry/schema/exceptions.py,sha256=rqVNb_oYrKM0dHPgvAemqCG6Um282LPPu4zwQ5cZq
|
|
169
169
|
strawberry/schema/execute.py,sha256=JgjtMCSCOuvHqAqI-dwmMV7bzpNEpiB9hVWTPS-GrFo,11979
|
170
170
|
strawberry/schema/name_converter.py,sha256=1rrpch-wBidlWfZ7hVouvIIhJpdxWfB5tWnO6PqYug8,6544
|
171
171
|
strawberry/schema/schema.py,sha256=oCsBg1yb3HmeIiMnT0PE3D7F2RSPHRk7k8pd7UyUSO4,19416
|
172
|
-
strawberry/schema/schema_converter.py,sha256
|
172
|
+
strawberry/schema/schema_converter.py,sha256=-_QZCcmHWIEjRPqEChtPMPbFtgz6YmLn8V6KXvZJMOk,37192
|
173
173
|
strawberry/schema/subscribe.py,sha256=UPXkmfudZjkf-quCZ6ZixPqrPz9wQDhHBChbjjYFJeY,6086
|
174
174
|
strawberry/schema/types/__init__.py,sha256=oHO3COWhL3L1KLYCJNY1XFf5xt2GGtHiMC-UaYbFfnA,68
|
175
175
|
strawberry/schema/types/base_scalars.py,sha256=JRUq0WjEkR9dFewstZnqnZKp0uOEipo4UXNF5dzRf4M,1971
|
176
176
|
strawberry/schema/types/concrete_type.py,sha256=axIyFZgdwNv-XYkiqX67464wuFX6Vp0jYATwnBZSUvM,750
|
177
|
-
strawberry/schema/types/scalar.py,sha256=
|
177
|
+
strawberry/schema/types/scalar.py,sha256=R840rzlH_TRM_2CdkA5rGDGLrJ8bh6UVDBhIGzVAVdg,2947
|
178
178
|
strawberry/schema/validation_rules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
179
179
|
strawberry/schema/validation_rules/one_of.py,sha256=fPuYzCyLT7p9y7dHF_sWTImArTQaEhyF664lZijB1Gw,2629
|
180
180
|
strawberry/schema_codegen/__init__.py,sha256=mN4Qmu5Iakht6nHpRpt9hCs8e--oTPlVtDJZJpzgHR4,24364
|
@@ -230,8 +230,8 @@ strawberry/utils/logging.py,sha256=U1cseHGquN09YFhFmRkiphfASKCyK0HUZREImPgVb0c,7
|
|
230
230
|
strawberry/utils/operation.py,sha256=SSXxN-vMqdHO6W2OZtip-1z7y4_A-eTVFdhDvhKeLCk,1193
|
231
231
|
strawberry/utils/str_converters.py,sha256=-eH1Cl16IO_wrBlsGM-km4IY0IKsjhjnSNGRGOwQjVM,897
|
232
232
|
strawberry/utils/typing.py,sha256=Ux0Hl46lhuXvOKK-C5hj6nlz3zDn8P4CUGH2nUVD2vU,13373
|
233
|
-
strawberry_graphql-0.258.
|
234
|
-
strawberry_graphql-0.258.
|
235
|
-
strawberry_graphql-0.258.
|
236
|
-
strawberry_graphql-0.258.
|
237
|
-
strawberry_graphql-0.258.
|
233
|
+
strawberry_graphql-0.258.1.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
|
234
|
+
strawberry_graphql-0.258.1.dist-info/METADATA,sha256=43UddiOsqnfI0MrQ_Keg2JA4VN7JDKyAI3okbpaE7fY,7539
|
235
|
+
strawberry_graphql-0.258.1.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
236
|
+
strawberry_graphql-0.258.1.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
|
237
|
+
strawberry_graphql-0.258.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
{strawberry_graphql-0.258.0.dist-info → strawberry_graphql-0.258.1.dist-info}/entry_points.txt
RENAMED
File without changes
|