strawberry-graphql 0.221.0__py3-none-any.whl → 0.221.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/types/info.py CHANGED
@@ -10,6 +10,7 @@ from typing import (
10
10
  Generic,
11
11
  List,
12
12
  Optional,
13
+ Tuple,
13
14
  Type,
14
15
  Union,
15
16
  )
@@ -38,6 +39,21 @@ class Info(Generic[ContextType, RootValueType]):
38
39
  _raw_info: GraphQLResolveInfo
39
40
  _field: StrawberryField
40
41
 
42
+ def __class_getitem__(cls, types: Union[type, Tuple[type, ...]]) -> Type[Info]:
43
+ """Workaround for when passing only one type.
44
+
45
+ Python doesn't yet support directly passing only one type to a generic class
46
+ that has typevars with defaults. This is a workaround for that.
47
+
48
+ See:
49
+ https://discuss.python.org/t/passing-only-one-typevar-of-two-when-using-defaults/49134
50
+ """
51
+
52
+ if not isinstance(types, tuple):
53
+ types = (types, Any) # type: ignore
54
+
55
+ return super().__class_getitem__(types) # type: ignore
56
+
41
57
  @property
42
58
  def field_name(self) -> str:
43
59
  return self._raw_info.field_name
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: strawberry-graphql
3
- Version: 0.221.0
3
+ Version: 0.221.1
4
4
  Summary: A library for creating GraphQL APIs
5
5
  Home-page: https://strawberry.rocks/
6
6
  License: MIT
@@ -222,7 +222,7 @@ strawberry/types/execution.py,sha256=qCqDMJgdAFwdc3uPzVTAKsZlu6fgxPLrFwkoX_PFBq8
222
222
  strawberry/types/fields/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
223
223
  strawberry/types/fields/resolver.py,sha256=Lwy2XVKnTbDyibk9pPsWsunlm22akXjy-gKCg22Tp1A,14130
224
224
  strawberry/types/graphql.py,sha256=3SWZEsa0Zy1eVW6vy75BnB7t9_lJVi6TBV3_1j3RNBs,687
225
- strawberry/types/info.py,sha256=kCsXvsTxrHubS936eOOxp2PNLWNqLRCPDckpVDspEk4,2827
225
+ strawberry/types/info.py,sha256=b1ZWW_wUop6XrGNcGHKBQeUYjlX-y8u3s2Wm_XhKPYI,3412
226
226
  strawberry/types/nodes.py,sha256=2ZVa1HOFgHZ96QTfz3QEr1fufi6Sz9hAzcZxsN7KtGE,5026
227
227
  strawberry/types/type_resolver.py,sha256=F0z_geS4VEun8EhD571LaTgI8ypjCeLfp910gF0Q3MY,6280
228
228
  strawberry/types/types.py,sha256=t5MOV4xiutPL2Ka02u3Z2V3eqy2R2JPYQxsqCnY2Aqk,7139
@@ -241,8 +241,8 @@ strawberry/utils/logging.py,sha256=flS7hV0JiIOEdXcrIjda4WyIWix86cpHHFNJL8gl1y4,7
241
241
  strawberry/utils/operation.py,sha256=Um-tBCPl3_bVFN2Ph7o1mnrxfxBes4HFCj6T0x4kZxE,1135
242
242
  strawberry/utils/str_converters.py,sha256=avIgPVLg98vZH9mA2lhzVdyyjqzLsK2NdBw9mJQ02Xk,813
243
243
  strawberry/utils/typing.py,sha256=Qxz1LwyVsNGV7LQW1dFsaUbsswj5LHBOdKLMom5eyEA,13491
244
- strawberry_graphql-0.221.0.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
245
- strawberry_graphql-0.221.0.dist-info/METADATA,sha256=0KsXiYNdNh45hcDBa7AElQz56ODfRQiMeP8FNjXBaF4,7740
246
- strawberry_graphql-0.221.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
247
- strawberry_graphql-0.221.0.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
248
- strawberry_graphql-0.221.0.dist-info/RECORD,,
244
+ strawberry_graphql-0.221.1.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
245
+ strawberry_graphql-0.221.1.dist-info/METADATA,sha256=QBJJOv0_Ebod03n0Zma4nMx-93WpOn9K54NqT49Dk-w,7740
246
+ strawberry_graphql-0.221.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
247
+ strawberry_graphql-0.221.1.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
248
+ strawberry_graphql-0.221.1.dist-info/RECORD,,