strawberry-graphql 0.234.1__py3-none-any.whl → 0.234.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.
@@ -8,10 +8,12 @@ from typing import (
8
8
  List,
9
9
  Optional,
10
10
  TypeVar,
11
+ get_origin,
11
12
  )
12
13
  from typing_extensions import get_args
13
14
 
14
15
  from strawberry.type import has_object_definition
16
+ from strawberry.utils.typing import is_generic_alias
15
17
 
16
18
 
17
19
  def in_async_context() -> bool:
@@ -77,8 +79,12 @@ def get_specialized_type_var_map(cls: type) -> Optional[Dict[str, type]]:
77
79
  """
78
80
  orig_bases = getattr(cls, "__orig_bases__", None)
79
81
  if orig_bases is None:
80
- # Not a specialized type
81
- return None
82
+ # Specialized generic aliases will not have __orig_bases__
83
+ if get_origin(cls) is not None and is_generic_alias(cls):
84
+ orig_bases = (cls,)
85
+ else:
86
+ # Not a specialized type
87
+ return None
82
88
 
83
89
  type_var_map = {}
84
90
 
@@ -88,9 +94,10 @@ def get_specialized_type_var_map(cls: type) -> Optional[Dict[str, type]]:
88
94
 
89
95
  for base in orig_bases:
90
96
  # Recursively get type var map from base classes
91
- base_type_var_map = get_specialized_type_var_map(base)
92
- if base_type_var_map is not None:
93
- type_var_map.update(base_type_var_map)
97
+ if base is not cls:
98
+ base_type_var_map = get_specialized_type_var_map(base)
99
+ if base_type_var_map is not None:
100
+ type_var_map.update(base_type_var_map)
94
101
 
95
102
  args = get_args(base)
96
103
  origin = getattr(base, "__origin__", None)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: strawberry-graphql
3
- Version: 0.234.1
3
+ Version: 0.234.2
4
4
  Summary: A library for creating GraphQL APIs
5
5
  Home-page: https://strawberry.rocks/
6
6
  License: MIT
@@ -240,13 +240,13 @@ strawberry/utils/debug.py,sha256=-MtRqM5e1J-GDNgKQXoVFcBB9f3dHvhEGrTc82uN4LM,137
240
240
  strawberry/utils/deprecations.py,sha256=RsnN63mPcq_BlH1nS8o-K9NOTtEF3fkW4zGaouJ0g9M,713
241
241
  strawberry/utils/graphql_lexer.py,sha256=U1mTE5fWy0gcF5fITiZzLWftCpo_C3xOi4BpQxasP3M,1085
242
242
  strawberry/utils/importer.py,sha256=hzTiWCeL9ju6opXTU_kjGpatbUy3UUTW8O1Y5hNA_W8,592
243
- strawberry/utils/inspect.py,sha256=6z-tJpiWWm6E4-O6OUfhu689W9k1uY0m3FDwAfVCiNs,2825
243
+ strawberry/utils/inspect.py,sha256=9pBnqnzkrd0hjXRSwErwsKLz8KGmmh2Aux_CeHjys74,3121
244
244
  strawberry/utils/logging.py,sha256=flS7hV0JiIOEdXcrIjda4WyIWix86cpHHFNJL8gl1y4,713
245
245
  strawberry/utils/operation.py,sha256=Um-tBCPl3_bVFN2Ph7o1mnrxfxBes4HFCj6T0x4kZxE,1135
246
246
  strawberry/utils/str_converters.py,sha256=avIgPVLg98vZH9mA2lhzVdyyjqzLsK2NdBw9mJQ02Xk,813
247
247
  strawberry/utils/typing.py,sha256=G92wuT2WhEGQrwjek_On2K8l0nyVFtBW3P7I_cfjG-8,13870
248
- strawberry_graphql-0.234.1.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
249
- strawberry_graphql-0.234.1.dist-info/METADATA,sha256=SMX3dgkXEo7VgOSIS2yyZI1hQK5JYJtdDpadTMlwots,7821
250
- strawberry_graphql-0.234.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
251
- strawberry_graphql-0.234.1.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
252
- strawberry_graphql-0.234.1.dist-info/RECORD,,
248
+ strawberry_graphql-0.234.2.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
249
+ strawberry_graphql-0.234.2.dist-info/METADATA,sha256=_gZW-JAxzhCF_jrZq2xw6D07P38OAXkdYsLR255YmpI,7821
250
+ strawberry_graphql-0.234.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
251
+ strawberry_graphql-0.234.2.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
252
+ strawberry_graphql-0.234.2.dist-info/RECORD,,