strawberry-graphql 0.169.0__py3-none-any.whl → 0.170.0__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.
@@ -5,7 +5,7 @@ from typing_extensions import Protocol
5
5
 
6
6
  from strawberry.custom_scalar import ScalarDefinition
7
7
  from strawberry.directive import StrawberryDirective
8
- from strawberry.enum import EnumDefinition
8
+ from strawberry.enum import EnumDefinition, EnumValue
9
9
  from strawberry.lazy_type import LazyType
10
10
  from strawberry.schema_directive import StrawberrySchemaDirective
11
11
  from strawberry.type import StrawberryList, StrawberryOptional
@@ -76,6 +76,9 @@ class NameConverter:
76
76
  def from_enum(self, enum: EnumDefinition) -> str:
77
77
  return enum.name
78
78
 
79
+ def from_enum_value(self, enum: EnumDefinition, enum_value: EnumValue) -> str:
80
+ return enum_value.name
81
+
79
82
  def from_directive(
80
83
  self, directive: Union[StrawberryDirective, StrawberrySchemaDirective]
81
84
  ) -> str:
@@ -150,7 +150,12 @@ class GraphQLCoreConverter:
150
150
  graphql_enum = CustomGraphQLEnumType(
151
151
  enum=enum,
152
152
  name=enum_name,
153
- values={item.name: self.from_enum_value(item) for item in enum.values},
153
+ values={
154
+ self.config.name_converter.from_enum_value(
155
+ enum, item
156
+ ): self.from_enum_value(item)
157
+ for item in enum.values
158
+ },
154
159
  description=enum.description,
155
160
  extensions={
156
161
  GraphQLCoreConverter.DEFINITION_BACKREF: enum,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: strawberry-graphql
3
- Version: 0.169.0
3
+ Version: 0.170.0
4
4
  Summary: A library for creating GraphQL APIs
5
5
  Home-page: https://strawberry.rocks/
6
6
  License: MIT
@@ -161,9 +161,9 @@ strawberry/schema/compat.py,sha256=fEOig4-X5Q3TrbuHcWXk1t69TzMfOr8vy3U-xB03yEU,1
161
161
  strawberry/schema/config.py,sha256=G1MC5DNKvSFNmg4bcu9XjQhceW8xZMIHf1hG3aS4SGA,599
162
162
  strawberry/schema/exceptions.py,sha256=_9Ua-lLRCJfbtd8B6MXILNKGI2SwHkcBNkAHYM7ITp8,534
163
163
  strawberry/schema/execute.py,sha256=vUjrEGzbO5L4YMIosx3RTVt9TQyogf6AeBbKWoMFdO0,10085
164
- strawberry/schema/name_converter.py,sha256=vhCSHlly0O-EA3qbI1Kzy4WtfjU2OFuE4FhUD9-7Yms,6158
164
+ strawberry/schema/name_converter.py,sha256=eQh4A-8fQAkhwgFhGk0_qFUQ2NPfqKO8DzKJVrxf0vk,6284
165
165
  strawberry/schema/schema.py,sha256=X_i3TE0Vvm9AV9QrV9qDBdSisbxAkpajpv1RXmQoYG8,11915
166
- strawberry/schema/schema_converter.py,sha256=eaVRlsHKD9pftGYCBGItGMoEqMdXiXnY_CAmpy3JxQM,30253
166
+ strawberry/schema/schema_converter.py,sha256=qG0-M90_xbUJlYf-hchHduAB3awKTfZBBpIHbzqa2z0,30382
167
167
  strawberry/schema/types/__init__.py,sha256=oHO3COWhL3L1KLYCJNY1XFf5xt2GGtHiMC-UaYbFfnA,68
168
168
  strawberry/schema/types/base_scalars.py,sha256=yg5Z7jGonN477L5-edMWLZuoehIpm0tdQJ9ATVV3kgc,1831
169
169
  strawberry/schema/types/concrete_type.py,sha256=4HUFIWPfAodU1cj0VAAuU1IrAnsG3XIX_P3X-6n_1IE,708
@@ -212,8 +212,8 @@ strawberry/utils/logging.py,sha256=pz1pRJtx5xX2ejGKNN-fG8zPA4SJjnq1HK9xaQpjd4s,1
212
212
  strawberry/utils/operation.py,sha256=-b2Qo6PtMO86emY-opS9ak-knRW_NQbXvEVPmscFRlk,1152
213
213
  strawberry/utils/str_converters.py,sha256=VdOnzaxhwJnmQl1Lon0VOjl72uXhM8tLfGxoGwn3arI,657
214
214
  strawberry/utils/typing.py,sha256=KtfgwoTTNYSw6IDZWf1McwzxZs5D1guNCVmXt8Mh9z8,10071
215
- strawberry_graphql-0.169.0.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
216
- strawberry_graphql-0.169.0.dist-info/METADATA,sha256=OMBv1k6S1vpN0SVj0EdVLvwTEQ-reuHReU_GMiteIs0,7551
217
- strawberry_graphql-0.169.0.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
218
- strawberry_graphql-0.169.0.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
219
- strawberry_graphql-0.169.0.dist-info/RECORD,,
215
+ strawberry_graphql-0.170.0.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
216
+ strawberry_graphql-0.170.0.dist-info/METADATA,sha256=2Q4B8EhcP0C-6LW6_k_Qj4_uU0H_7d6-I7l1udCzv_g,7551
217
+ strawberry_graphql-0.170.0.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
218
+ strawberry_graphql-0.170.0.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
219
+ strawberry_graphql-0.170.0.dist-info/RECORD,,