strawberry-graphql 0.271.2__py3-none-any.whl → 0.272.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/cli/commands/export_schema.py +1 -1
- strawberry/extensions/__init__.py +2 -0
- strawberry/extensions/disable_introspection.py +36 -0
- {strawberry_graphql-0.271.2.dist-info → strawberry_graphql-0.272.1.dist-info}/METADATA +1 -1
- {strawberry_graphql-0.271.2.dist-info → strawberry_graphql-0.272.1.dist-info}/RECORD +8 -7
- {strawberry_graphql-0.271.2.dist-info → strawberry_graphql-0.272.1.dist-info}/LICENSE +0 -0
- {strawberry_graphql-0.271.2.dist-info → strawberry_graphql-0.272.1.dist-info}/WHEEL +0 -0
- {strawberry_graphql-0.271.2.dist-info → strawberry_graphql-0.272.1.dist-info}/entry_points.txt +0 -0
@@ -32,7 +32,7 @@ def export_schema(
|
|
32
32
|
schema_text = print_schema(schema_symbol)
|
33
33
|
|
34
34
|
if output:
|
35
|
-
Path(output).write_text(schema_text)
|
35
|
+
Path(output).write_text(schema_text + "\n", encoding="utf-8")
|
36
36
|
typer.echo(f"Schema exported to {output}")
|
37
37
|
else:
|
38
38
|
print(schema_text) # noqa: T201
|
@@ -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"]
|
@@ -21,7 +21,7 @@ strawberry/cli/__init__.py,sha256=ibaAZsZEk76j9eK1zcbsCN9It-pd0rneCuEGPzhxJWA,64
|
|
21
21
|
strawberry/cli/app.py,sha256=tTMBV1pdWqMcwjWO2yn-8oLDhMhfJvUzyQtWs75LWJ0,54
|
22
22
|
strawberry/cli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
23
23
|
strawberry/cli/commands/codegen.py,sha256=WbX8uqF-dpQk1QjQm3H4AvNSZ4lIUOTSPghii3attj8,3812
|
24
|
-
strawberry/cli/commands/export_schema.py,sha256=
|
24
|
+
strawberry/cli/commands/export_schema.py,sha256=pyp_Q3BiO7lFH0L3mNPvr7UF8hlhcoUPqqBP4JPWUu0,1049
|
25
25
|
strawberry/cli/commands/schema_codegen.py,sha256=G6eV08a51sjVxCm3jn75oPn9hC8YarKiAKOY5bpTuKU,749
|
26
26
|
strawberry/cli/commands/server.py,sha256=qj5wn22HvyJDzwnWzduIWRnS912XvD7GRhPGJkbLaz4,2217
|
27
27
|
strawberry/cli/commands/upgrade/__init__.py,sha256=nY_Cj4yOj3CVdzEPWMAgof-dIr804sEJ-cCVOfI6UWo,2480
|
@@ -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=
|
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.
|
234
|
-
strawberry_graphql-0.
|
235
|
-
strawberry_graphql-0.
|
236
|
-
strawberry_graphql-0.
|
237
|
-
strawberry_graphql-0.
|
234
|
+
strawberry_graphql-0.272.1.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
|
235
|
+
strawberry_graphql-0.272.1.dist-info/METADATA,sha256=To6q3sJkFsHn0QdAkX0QLj0h5sJ-ywhw7u0I35yaikI,7444
|
236
|
+
strawberry_graphql-0.272.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
237
|
+
strawberry_graphql-0.272.1.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
|
238
|
+
strawberry_graphql-0.272.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
{strawberry_graphql-0.271.2.dist-info → strawberry_graphql-0.272.1.dist-info}/entry_points.txt
RENAMED
File without changes
|