strawberry-graphql 0.270.5__py3-none-any.whl → 0.270.6__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/tools/create_type.py +8 -3
- {strawberry_graphql-0.270.5.dist-info → strawberry_graphql-0.270.6.dist-info}/METADATA +1 -1
- {strawberry_graphql-0.270.5.dist-info → strawberry_graphql-0.270.6.dist-info}/RECORD +6 -6
- {strawberry_graphql-0.270.5.dist-info → strawberry_graphql-0.270.6.dist-info}/LICENSE +0 -0
- {strawberry_graphql-0.270.5.dist-info → strawberry_graphql-0.270.6.dist-info}/WHEEL +0 -0
- {strawberry_graphql-0.270.5.dist-info → strawberry_graphql-0.270.6.dist-info}/entry_points.txt +0 -0
strawberry/tools/create_type.py
CHANGED
@@ -50,15 +50,20 @@ def create_type(
|
|
50
50
|
if not isinstance(field, StrawberryField):
|
51
51
|
raise TypeError("Field is not an instance of StrawberryField")
|
52
52
|
|
53
|
-
|
53
|
+
# Fields created using `strawberry.field` without a resolver don't have a
|
54
|
+
# `python_name`. In that case, we fall back to the field's `graphql_name`
|
55
|
+
# set via the `name` argument passed to `strawberry.field`.
|
56
|
+
field_name = field.python_name or field.graphql_name
|
57
|
+
|
58
|
+
if field_name is None:
|
54
59
|
raise ValueError(
|
55
60
|
"Field doesn't have a name. Fields passed to "
|
56
61
|
"`create_type` must define a name by passing the "
|
57
62
|
"`name` argument to `strawberry.field`."
|
58
63
|
)
|
59
64
|
|
60
|
-
namespace[
|
61
|
-
annotations[
|
65
|
+
namespace[field_name] = field
|
66
|
+
annotations[field_name] = field.type
|
62
67
|
|
63
68
|
namespace["__annotations__"] = annotations # type: ignore
|
64
69
|
|
@@ -193,7 +193,7 @@ strawberry/subscriptions/protocols/graphql_ws/types.py,sha256=Uumiz-1O5qQnx-ERBa
|
|
193
193
|
strawberry/test/__init__.py,sha256=lKVbKJDBnrYSPYHIKrg54UpaZcSoL93Z01zOpA1IzZM,115
|
194
194
|
strawberry/test/client.py,sha256=ILAttb6A3jplH5wJNMeyyT1u_Q8KnollfpYLP_BVZR4,6438
|
195
195
|
strawberry/tools/__init__.py,sha256=pdGpZx8wpq03VfUZJyF9JtYxZhGqzzxCiipsalWxJX4,127
|
196
|
-
strawberry/tools/create_type.py,sha256
|
196
|
+
strawberry/tools/create_type.py,sha256=y10LgJnWDFtZB-xHLqpVg5ySqvz5KSFC6PNflogie1Q,2329
|
197
197
|
strawberry/tools/merge_types.py,sha256=hUMRRNM28FyPp70jRA3d4svv9WoEBjaNpihBt3DaY0I,1023
|
198
198
|
strawberry/types/__init__.py,sha256=baWEdDkkmCcITOhkg2hNUOenrNV1OYdxGE5qgvIRwwU,351
|
199
199
|
strawberry/types/arguments.py,sha256=DVouyH70uvTcFP3PmRzo8QdMThoqXdigJbWE9Lgn5pU,9849
|
@@ -230,8 +230,8 @@ strawberry/utils/logging.py,sha256=U1cseHGquN09YFhFmRkiphfASKCyK0HUZREImPgVb0c,7
|
|
230
230
|
strawberry/utils/operation.py,sha256=s7ajvLg_q6v2mg47kEMQPjO_J-XluMKTCwo4d47mGvE,1195
|
231
231
|
strawberry/utils/str_converters.py,sha256=-eH1Cl16IO_wrBlsGM-km4IY0IKsjhjnSNGRGOwQjVM,897
|
232
232
|
strawberry/utils/typing.py,sha256=SDvX-Du-9HAV3-XXjqi7Q5f5qPDDFd_gASIITiwBQT4,14073
|
233
|
-
strawberry_graphql-0.270.
|
234
|
-
strawberry_graphql-0.270.
|
235
|
-
strawberry_graphql-0.270.
|
236
|
-
strawberry_graphql-0.270.
|
237
|
-
strawberry_graphql-0.270.
|
233
|
+
strawberry_graphql-0.270.6.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
|
234
|
+
strawberry_graphql-0.270.6.dist-info/METADATA,sha256=hiHH8w95HcNw-GZSfgFZYts7rHTL2zLBZiGtoBwaUP4,7757
|
235
|
+
strawberry_graphql-0.270.6.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
236
|
+
strawberry_graphql-0.270.6.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
|
237
|
+
strawberry_graphql-0.270.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|
{strawberry_graphql-0.270.5.dist-info → strawberry_graphql-0.270.6.dist-info}/entry_points.txt
RENAMED
File without changes
|