strawberry-graphql 0.268.0__py3-none-any.whl → 0.268.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.
@@ -817,9 +817,9 @@ class GraphQLCoreConverter:
817
817
 
818
818
  scalar_name = self.config.name_converter.from_type(scalar_definition)
819
819
 
820
- if scalar_name not in self.type_map:
821
- from strawberry.relay import GlobalID
820
+ from strawberry.relay import GlobalID
822
821
 
822
+ if scalar_name not in self.type_map:
823
823
  if scalar is GlobalID and hasattr(GraphQLNamedType, "reserved_types"):
824
824
  GraphQLNamedType.reserved_types.pop("ID")
825
825
 
@@ -841,7 +841,17 @@ class GraphQLCoreConverter:
841
841
  # TODO: the other definition might not be a scalar, we should
842
842
  # handle this case better, since right now we assume it is a scalar
843
843
 
844
- if other_definition != scalar_definition:
844
+ # special case to allow GlobalID to be used as an ID scalar
845
+ # TODO: we need to find a better way to handle this, might be
846
+ # worth reworking our scalar implementation.
847
+ if (
848
+ hasattr(other_definition, "origin")
849
+ and hasattr(scalar_definition, "origin")
850
+ and other_definition.origin == GlobalID
851
+ and scalar_definition.origin == GraphQLID
852
+ ):
853
+ pass
854
+ elif other_definition != scalar_definition:
845
855
  other_definition = cast("ScalarDefinition", other_definition)
846
856
 
847
857
  raise ScalarAlreadyRegisteredError(scalar_definition, other_definition)
@@ -40,6 +40,7 @@ def _make_scalar_definition(scalar_type: GraphQLScalarType) -> ScalarDefinition:
40
40
  parse_literal=scalar_type.parse_literal,
41
41
  parse_value=scalar_type.parse_value,
42
42
  implementation=scalar_type,
43
+ origin=scalar_type,
43
44
  )
44
45
 
45
46
 
@@ -43,6 +43,7 @@ class ScalarDefinition(StrawberryType):
43
43
  parse_value: Optional[Callable]
44
44
  parse_literal: Optional[Callable]
45
45
  directives: Iterable[object] = ()
46
+ origin: Optional[GraphQLScalarType | type] = None
46
47
 
47
48
  # Optionally store the GraphQLScalarType instance so that we don't get
48
49
  # duplicates
@@ -115,6 +116,7 @@ def _process_scalar(
115
116
  parse_literal=parse_literal,
116
117
  parse_value=parse_value,
117
118
  directives=directives,
119
+ origin=cls, # type: ignore[arg-type]
118
120
  _source_file=_source_file,
119
121
  _source_line=_source_line,
120
122
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: strawberry-graphql
3
- Version: 0.268.0
3
+ Version: 0.268.1
4
4
  Summary: A library for creating GraphQL APIs
5
5
  License: MIT
6
6
  Keywords: graphql,api,rest,starlette,async
@@ -168,11 +168,11 @@ strawberry/schema/config.py,sha256=KeZ1Pc1gvYK0fOx9Aghx7m0Av8sWexycl3HJGFgHPvg,9
168
168
  strawberry/schema/exceptions.py,sha256=rqVNb_oYrKM0dHPgvAemqCG6Um282LPPu4zwQ5cZqs4,584
169
169
  strawberry/schema/name_converter.py,sha256=xFOXEgqldFkxXRkIQvsJN1dPkWbEUaIrTYNOMYSEVwQ,6945
170
170
  strawberry/schema/schema.py,sha256=rDfNclXSRHqn3NNGzPAovZoVeMh0VC5wVCCUprwZJV8,34215
171
- strawberry/schema/schema_converter.py,sha256=yuYafNwa9zs6l-GmuGtxdjYwawxjiU6zmwIgJ-aLhV4,39308
171
+ strawberry/schema/schema_converter.py,sha256=u12Og8eUX8SNMtJB6LYkj9zEpoQs-rDOXpN7tU8JG7k,39785
172
172
  strawberry/schema/types/__init__.py,sha256=oHO3COWhL3L1KLYCJNY1XFf5xt2GGtHiMC-UaYbFfnA,68
173
173
  strawberry/schema/types/base_scalars.py,sha256=JRUq0WjEkR9dFewstZnqnZKp0uOEipo4UXNF5dzRf4M,1971
174
174
  strawberry/schema/types/concrete_type.py,sha256=axIyFZgdwNv-XYkiqX67464wuFX6Vp0jYATwnBZSUvM,750
175
- strawberry/schema/types/scalar.py,sha256=X_9R7tLDINcs9UeExUUqq3_U2JkhCVJBeEhDFDUt3Tc,2347
175
+ strawberry/schema/types/scalar.py,sha256=bg9AumdmYUBuvaKoEZtP9YKJ7lwMtDMCWFTsZQwpdQY,2375
176
176
  strawberry/schema/validation_rules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
177
177
  strawberry/schema/validation_rules/one_of.py,sha256=fPuYzCyLT7p9y7dHF_sWTImArTQaEhyF664lZijB1Gw,2629
178
178
  strawberry/schema_codegen/__init__.py,sha256=mN4Qmu5Iakht6nHpRpt9hCs8e--oTPlVtDJZJpzgHR4,24364
@@ -212,7 +212,7 @@ strawberry/types/mutation.py,sha256=cg-_O2WWnZ-GSwOIv0toSdxlGeY2lhBBxZ24AifJuSM,
212
212
  strawberry/types/nodes.py,sha256=RwZB43OT9BS3Cqjgq4AazqOfyq_y0GD2ysC86EDBv5U,5134
213
213
  strawberry/types/object_type.py,sha256=SZOzxaS318079G-pr-1PM5iMoTddxdw8KD4cI67IhzI,15579
214
214
  strawberry/types/private.py,sha256=DhJs50XVGtOXlxWZFkRpMxQ5_6oki0-x_WQsV1bGUxk,518
215
- strawberry/types/scalar.py,sha256=CM24Ixg4DKxxI1C6hTNGYVitohJibs8BpGtntRZvMXw,6284
215
+ strawberry/types/scalar.py,sha256=vUWGwAYgcfY26jQUdBJ1tGOvrBq92V0p9L8AWXM7bkk,6384
216
216
  strawberry/types/type_resolver.py,sha256=fH2ZOK4dAGgu8AMPi-JAXe_kEAbvvw2MCYXqbpx-kTc,6529
217
217
  strawberry/types/union.py,sha256=rwZoJcMdUxJBlYMwx3ONByv6BylhvXT0Bflem6xzMM4,10090
218
218
  strawberry/types/unset.py,sha256=7DVK-WWxVLo41agvavTvIbphE42BmY8UpGolXfasIvw,1682
@@ -229,8 +229,8 @@ strawberry/utils/logging.py,sha256=U1cseHGquN09YFhFmRkiphfASKCyK0HUZREImPgVb0c,7
229
229
  strawberry/utils/operation.py,sha256=s7ajvLg_q6v2mg47kEMQPjO_J-XluMKTCwo4d47mGvE,1195
230
230
  strawberry/utils/str_converters.py,sha256=-eH1Cl16IO_wrBlsGM-km4IY0IKsjhjnSNGRGOwQjVM,897
231
231
  strawberry/utils/typing.py,sha256=SDvX-Du-9HAV3-XXjqi7Q5f5qPDDFd_gASIITiwBQT4,14073
232
- strawberry_graphql-0.268.0.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
233
- strawberry_graphql-0.268.0.dist-info/METADATA,sha256=fJm7Ywqawb8NQPG8GK7RUdtiqbrlOIIHJ8Q2sSaQlPw,7679
234
- strawberry_graphql-0.268.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
235
- strawberry_graphql-0.268.0.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
236
- strawberry_graphql-0.268.0.dist-info/RECORD,,
232
+ strawberry_graphql-0.268.1.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
233
+ strawberry_graphql-0.268.1.dist-info/METADATA,sha256=0KP8VbWiBIyL4DP__ItZildr2PoqR_WjXmRoTc_9PDE,7679
234
+ strawberry_graphql-0.268.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
235
+ strawberry_graphql-0.268.1.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
236
+ strawberry_graphql-0.268.1.dist-info/RECORD,,