strawberry-graphql 0.271.2__py3-none-any.whl → 0.272.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.
@@ -2,6 +2,7 @@ import warnings
2
2
 
3
3
  from .add_validation_rules import AddValidationRules
4
4
  from .base_extension import LifecycleStep, SchemaExtension
5
+ from .disable_introspection import DisableIntrospection
5
6
  from .disable_validation import DisableValidation
6
7
  from .field_extension import FieldExtension
7
8
  from .mask_errors import MaskErrors
@@ -29,6 +30,7 @@ def __getattr__(name: str) -> type[SchemaExtension]:
29
30
 
30
31
  __all__ = [
31
32
  "AddValidationRules",
33
+ "DisableIntrospection",
32
34
  "DisableValidation",
33
35
  "FieldExtension",
34
36
  "IgnoreContext",
@@ -0,0 +1,36 @@
1
+ from graphql.validation import NoSchemaIntrospectionCustomRule
2
+
3
+ from strawberry.extensions import AddValidationRules
4
+
5
+
6
+ class DisableIntrospection(AddValidationRules):
7
+ """Disable introspection queries.
8
+
9
+ Example:
10
+
11
+ ```python
12
+ import strawberry
13
+ from strawberry.extensions import DisableIntrospection
14
+
15
+
16
+ @strawberry.type
17
+ class Query:
18
+ @strawberry.field
19
+ def hello(self) -> str:
20
+ return "Hello, world!"
21
+
22
+
23
+ schema = strawberry.Schema(
24
+ Query,
25
+ extensions=[
26
+ DisableIntrospection(),
27
+ ],
28
+ )
29
+ ```
30
+ """
31
+
32
+ def __init__(self) -> None:
33
+ super().__init__([NoSchemaIntrospectionCustomRule])
34
+
35
+
36
+ __all__ = ["DisableIntrospection"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: strawberry-graphql
3
- Version: 0.271.2
3
+ Version: 0.272.0
4
4
  Summary: A library for creating GraphQL APIs
5
5
  License: MIT
6
6
  Keywords: graphql,api,rest,starlette,async
@@ -88,11 +88,12 @@ strawberry/ext/dataclasses/README.md,sha256=WE3523o9gBGpa18ikiQhgEUNuuBJWR5tMKmj
88
88
  strawberry/ext/dataclasses/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
89
89
  strawberry/ext/dataclasses/dataclasses.py,sha256=bTW8nRwflW7_JtGhzXiKhe9Kajha_fgCfR0jVKrCzBw,2287
90
90
  strawberry/ext/mypy_plugin.py,sha256=KqpEWUnQftmmlC0CtK33H1FMR7P-WdI-F9Evnc60Mm0,20458
91
- strawberry/extensions/__init__.py,sha256=5U5A4HEXyJHT74MP6j_zx7Mom6S7ooklK-c9xA-kdHQ,1224
91
+ strawberry/extensions/__init__.py,sha256=2TXnEVXumViXzBe-9ppb0CX90Wbc6644IE7aJQAEAXs,1308
92
92
  strawberry/extensions/add_validation_rules.py,sha256=YwC_27jUpQ6DWcCB1RsuE1JD8R5rV7LAu5fVjdLchYs,1358
93
93
  strawberry/extensions/base_extension.py,sha256=ihsbUrhYt-x4X1j5a34FASmNF661Xev-3w4Qc5gUbHw,2351
94
94
  strawberry/extensions/context.py,sha256=9hTWNjxk-Kyr4RkpKE3BY05dkgS4WLRjJKj4tq28Lj8,7185
95
95
  strawberry/extensions/directives.py,sha256=F-ayBAImKHFap61WUJ_XO02COOFn3nWyN7cLkV9Dph0,3032
96
+ strawberry/extensions/disable_introspection.py,sha256=7FmktNvc9CzOJG9xf_nYG3LThs0cv-g2P-Kzlerna7w,717
96
97
  strawberry/extensions/disable_validation.py,sha256=WaA7x6Q-K4IMnvx35OQ1UtokIKaxkWvO_OJO9fFM_vA,750
97
98
  strawberry/extensions/field_extension.py,sha256=VUwUBbf57Vp_Ukc3Rh9eZDRuF2ubzRRipzsU-w5bAFc,5561
98
99
  strawberry/extensions/mask_errors.py,sha256=xPGN24l6C_zZ174jHQbOhSShTqqAB58ithhuTZjBXGQ,1481
@@ -230,8 +231,8 @@ strawberry/utils/logging.py,sha256=U1cseHGquN09YFhFmRkiphfASKCyK0HUZREImPgVb0c,7
230
231
  strawberry/utils/operation.py,sha256=CCIREeh3-CzjvjyjhmYPRCVDZUX36jAxF6LbK8r5wEw,1222
231
232
  strawberry/utils/str_converters.py,sha256=-eH1Cl16IO_wrBlsGM-km4IY0IKsjhjnSNGRGOwQjVM,897
232
233
  strawberry/utils/typing.py,sha256=SDvX-Du-9HAV3-XXjqi7Q5f5qPDDFd_gASIITiwBQT4,14073
233
- strawberry_graphql-0.271.2.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
234
- strawberry_graphql-0.271.2.dist-info/METADATA,sha256=euNsglms3bL5HtvD7KdxfohprfZjy9n1GIt3-lqQCvo,7444
235
- strawberry_graphql-0.271.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
236
- strawberry_graphql-0.271.2.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
237
- strawberry_graphql-0.271.2.dist-info/RECORD,,
234
+ strawberry_graphql-0.272.0.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
235
+ strawberry_graphql-0.272.0.dist-info/METADATA,sha256=x6fAPZtfxCR9xdkVpPIFsgWmHLDYPTpJmZfKoMU0kpI,7444
236
+ strawberry_graphql-0.272.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
237
+ strawberry_graphql-0.272.0.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
238
+ strawberry_graphql-0.272.0.dist-info/RECORD,,