strawberry-graphql 0.269.0.dev1746905409__tar.gz → 0.270.0__tar.gz
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_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/PKG-INFO +1 -1
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/pyproject.toml +1 -1
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/__init__.py +0 -2
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/annotation.py +0 -7
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/http/__init__.py +10 -14
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/http/async_base_view.py +8 -81
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/http/base.py +6 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/http/sync_base_view.py +2 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/printer/printer.py +2 -10
- strawberry_graphql-0.270.0/strawberry/quart/views.py +216 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/schema/base.py +3 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/schema/config.py +0 -1
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/schema/schema.py +94 -48
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/schema/schema_converter.py +8 -12
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/schema/types/scalar.py +1 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/static/graphiql.html +5 -5
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/types/arguments.py +5 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/types/info.py +5 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/types/scalar.py +2 -0
- strawberry_graphql-0.269.0.dev1746905409/strawberry/quart/views.py +0 -137
- strawberry_graphql-0.269.0.dev1746905409/strawberry/schema/_graphql_core.py +0 -46
- strawberry_graphql-0.269.0.dev1746905409/strawberry/streamable.py +0 -36
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/LICENSE +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/README.md +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/__main__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/aiohttp/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/aiohttp/test/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/aiohttp/test/client.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/aiohttp/views.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/asgi/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/asgi/test/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/asgi/test/client.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/chalice/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/chalice/views.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/channels/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/channels/handlers/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/channels/handlers/base.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/channels/handlers/http_handler.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/channels/handlers/ws_handler.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/channels/router.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/channels/testing.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/cli/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/cli/app.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/cli/commands/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/cli/commands/codegen.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/cli/commands/export_schema.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/cli/commands/schema_codegen.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/cli/commands/server.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/cli/commands/upgrade/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/cli/commands/upgrade/_fake_progress.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/cli/commands/upgrade/_run_codemod.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/cli/constants.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/cli/debug_server.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/cli/utils/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/cli/utils/load_schema.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/codegen/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/codegen/exceptions.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/codegen/plugins/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/codegen/plugins/print_operation.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/codegen/plugins/python.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/codegen/plugins/typescript.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/codegen/query_codegen.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/codegen/types.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/codemods/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/codemods/annotated_unions.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/codemods/update_imports.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/dataloader.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/directive.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/django/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/django/apps.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/django/context.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/django/test/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/django/test/client.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/django/views.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/exceptions/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/exceptions/conflicting_arguments.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/exceptions/duplicated_type_name.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/exceptions/exception.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/exceptions/exception_source.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/exceptions/handler.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/exceptions/invalid_argument_type.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/exceptions/invalid_union_type.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/exceptions/missing_arguments_annotations.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/exceptions/missing_dependencies.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/exceptions/missing_field_annotation.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/exceptions/missing_return_annotation.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/exceptions/object_is_not_a_class.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/exceptions/object_is_not_an_enum.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/exceptions/permission_fail_silently_requires_optional.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/exceptions/private_strawberry_field.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/exceptions/scalar_already_registered.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/exceptions/syntax.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/exceptions/unresolved_field_type.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/exceptions/utils/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/exceptions/utils/source_finder.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/experimental/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/experimental/pydantic/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/experimental/pydantic/_compat.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/experimental/pydantic/conversion.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/experimental/pydantic/conversion_types.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/experimental/pydantic/error_type.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/experimental/pydantic/exceptions.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/experimental/pydantic/fields.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/experimental/pydantic/object_type.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/experimental/pydantic/utils.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/ext/LICENSE +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/ext/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/ext/dataclasses/LICENSE +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/ext/dataclasses/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/ext/dataclasses/dataclasses.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/ext/mypy_plugin.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/extensions/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/extensions/add_validation_rules.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/extensions/base_extension.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/extensions/context.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/extensions/directives.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/extensions/disable_validation.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/extensions/field_extension.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/extensions/mask_errors.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/extensions/max_aliases.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/extensions/max_tokens.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/extensions/parser_cache.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/extensions/pyinstrument.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/extensions/query_depth_limiter.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/extensions/runner.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/extensions/tracing/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/extensions/tracing/apollo.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/extensions/tracing/datadog.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/extensions/tracing/opentelemetry.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/extensions/tracing/utils.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/extensions/utils.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/extensions/validation_cache.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/fastapi/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/fastapi/context.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/fastapi/router.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/federation/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/federation/argument.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/federation/enum.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/federation/field.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/federation/mutation.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/federation/object_type.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/federation/scalar.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/federation/schema.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/federation/schema_directive.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/federation/schema_directives.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/federation/types.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/federation/union.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/field_extensions/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/field_extensions/input_mutation.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/file_uploads/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/file_uploads/scalars.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/file_uploads/utils.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/flask/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/flask/views.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/http/exceptions.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/http/ides.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/http/parse_content_type.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/http/temporal_response.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/http/types.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/http/typevars.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/litestar/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/litestar/controller.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/parent.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/permission.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/printer/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/printer/ast_from_value.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/py.typed +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/quart/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/relay/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/relay/exceptions.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/relay/fields.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/relay/types.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/relay/utils.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/resolvers.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/sanic/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/sanic/context.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/sanic/utils.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/sanic/views.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/scalars.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/schema/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/schema/compat.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/schema/exceptions.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/schema/name_converter.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/schema/types/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/schema/types/base_scalars.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/schema/types/concrete_type.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/schema/validation_rules/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/schema/validation_rules/one_of.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/schema_codegen/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/schema_directive.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/schema_directives.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/static/apollo-sandbox.html +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/static/pathfinder.html +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/subscriptions/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/subscriptions/protocols/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/subscriptions/protocols/graphql_transport_ws/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/subscriptions/protocols/graphql_transport_ws/handlers.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/subscriptions/protocols/graphql_transport_ws/types.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/subscriptions/protocols/graphql_ws/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/subscriptions/protocols/graphql_ws/handlers.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/subscriptions/protocols/graphql_ws/types.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/test/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/test/client.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/tools/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/tools/create_type.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/tools/merge_types.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/types/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/types/auto.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/types/base.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/types/cast.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/types/enum.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/types/execution.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/types/field.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/types/fields/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/types/fields/resolver.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/types/graphql.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/types/lazy_type.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/types/maybe.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/types/mutation.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/types/nodes.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/types/object_type.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/types/private.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/types/type_resolver.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/types/union.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/types/unset.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/utils/__init__.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/utils/aio.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/utils/await_maybe.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/utils/dataclasses.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/utils/debug.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/utils/deprecations.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/utils/graphql_lexer.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/utils/importer.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/utils/inspect.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/utils/logging.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/utils/operation.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/utils/str_converters.py +0 -0
- {strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/utils/typing.py +0 -0
{strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/__init__.py
RENAMED
@@ -11,7 +11,6 @@ from .permission import BasePermission
|
|
11
11
|
from .scalars import ID
|
12
12
|
from .schema import Schema
|
13
13
|
from .schema_directive import schema_directive
|
14
|
-
from .streamable import Streamable
|
15
14
|
from .types.arguments import argument
|
16
15
|
from .types.auto import auto
|
17
16
|
from .types.cast import cast
|
@@ -38,7 +37,6 @@ __all__ = [
|
|
38
37
|
"Private",
|
39
38
|
"Schema",
|
40
39
|
"Some",
|
41
|
-
"Streamable",
|
42
40
|
"argument",
|
43
41
|
"asdict",
|
44
42
|
"auto",
|
{strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/annotation.py
RENAMED
@@ -17,7 +17,6 @@ from typing import (
|
|
17
17
|
)
|
18
18
|
from typing_extensions import Self, get_args, get_origin
|
19
19
|
|
20
|
-
from strawberry.streamable import StrawberryStreamable
|
21
20
|
from strawberry.types.base import (
|
22
21
|
StrawberryList,
|
23
22
|
StrawberryMaybe,
|
@@ -144,8 +143,6 @@ class StrawberryAnnotation:
|
|
144
143
|
|
145
144
|
if self._is_lazy_type(evaled_type):
|
146
145
|
return evaled_type
|
147
|
-
if self._is_streamable(evaled_type, args):
|
148
|
-
return self.create_list(list[evaled_type])
|
149
146
|
if self._is_list(evaled_type):
|
150
147
|
return self.create_list(evaled_type)
|
151
148
|
if type_of := self._get_maybe_type(evaled_type):
|
@@ -326,10 +323,6 @@ class StrawberryAnnotation:
|
|
326
323
|
def _get_maybe_type(cls, annotation: Any) -> type | None:
|
327
324
|
return get_args(annotation)[0] if _annotation_is_maybe(annotation) else None
|
328
325
|
|
329
|
-
@classmethod
|
330
|
-
def _is_streamable(cls, annotation: Any, args: list[Any]) -> bool:
|
331
|
-
return any(isinstance(arg, StrawberryStreamable) for arg in args)
|
332
|
-
|
333
326
|
@classmethod
|
334
327
|
def _is_strawberry_type(cls, evaled_type: Any) -> bool:
|
335
328
|
# Prevent import cycles
|
{strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/http/__init__.py
RENAMED
@@ -1,13 +1,11 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
3
|
from dataclasses import dataclass
|
4
|
-
from typing import Any, Optional
|
4
|
+
from typing import TYPE_CHECKING, Any, Optional
|
5
5
|
from typing_extensions import Literal, TypedDict
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
ResultType,
|
10
|
-
)
|
7
|
+
if TYPE_CHECKING:
|
8
|
+
from strawberry.types import ExecutionResult
|
11
9
|
|
12
10
|
|
13
11
|
class GraphQLHTTPResponse(TypedDict, total=False):
|
@@ -16,16 +14,13 @@ class GraphQLHTTPResponse(TypedDict, total=False):
|
|
16
14
|
extensions: Optional[dict[str, object]]
|
17
15
|
|
18
16
|
|
19
|
-
def process_result(result:
|
20
|
-
|
21
|
-
return result
|
17
|
+
def process_result(result: ExecutionResult) -> GraphQLHTTPResponse:
|
18
|
+
data: GraphQLHTTPResponse = {"data": result.data}
|
22
19
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
**({"extensions": extensions} if extensions else {}),
|
28
|
-
}
|
20
|
+
if result.errors:
|
21
|
+
data["errors"] = [err.formatted for err in result.errors]
|
22
|
+
if result.extensions:
|
23
|
+
data["extensions"] = result.extensions
|
29
24
|
|
30
25
|
return data
|
31
26
|
|
@@ -37,6 +32,7 @@ class GraphQLRequestData:
|
|
37
32
|
query: Optional[str]
|
38
33
|
variables: Optional[dict[str, Any]]
|
39
34
|
operation_name: Optional[str]
|
35
|
+
extensions: Optional[dict[str, Any]]
|
40
36
|
protocol: Literal["http", "multipart-subscription"] = "http"
|
41
37
|
|
42
38
|
|
@@ -25,9 +25,6 @@ from strawberry.http import (
|
|
25
25
|
process_result,
|
26
26
|
)
|
27
27
|
from strawberry.http.ides import GraphQL_IDE
|
28
|
-
from strawberry.schema._graphql_core import (
|
29
|
-
GraphQLIncrementalExecutionResults,
|
30
|
-
)
|
31
28
|
from strawberry.schema.base import BaseSchema
|
32
29
|
from strawberry.schema.exceptions import InvalidOperationTypeError
|
33
30
|
from strawberry.subscriptions import GRAPHQL_TRANSPORT_WS_PROTOCOL, GRAPHQL_WS_PROTOCOL
|
@@ -207,6 +204,7 @@ class AsyncBaseHTTPView(
|
|
207
204
|
context_value=context,
|
208
205
|
root_value=root_value,
|
209
206
|
operation_name=request_data.operation_name,
|
207
|
+
operation_extensions=request_data.extensions,
|
210
208
|
)
|
211
209
|
|
212
210
|
return await self.schema.execute(
|
@@ -216,6 +214,7 @@ class AsyncBaseHTTPView(
|
|
216
214
|
context_value=context,
|
217
215
|
operation_name=request_data.operation_name,
|
218
216
|
allowed_operation_types=allowed_operation_types,
|
217
|
+
operation_extensions=request_data.extensions,
|
219
218
|
)
|
220
219
|
|
221
220
|
async def parse_multipart(self, request: AsyncHTTPRequestAdapter) -> dict[str, str]:
|
@@ -261,7 +260,7 @@ class AsyncBaseHTTPView(
|
|
261
260
|
root_value: Optional[RootValue] = UNSET,
|
262
261
|
) -> WebSocketResponse: ...
|
263
262
|
|
264
|
-
async def run(
|
263
|
+
async def run(
|
265
264
|
self,
|
266
265
|
request: Union[Request, WebSocketRequest],
|
267
266
|
context: Optional[Context] = UNSET,
|
@@ -352,75 +351,6 @@ class AsyncBaseHTTPView(
|
|
352
351
|
"Content-Type": "multipart/mixed;boundary=graphql;subscriptionSpec=1.0,application/json",
|
353
352
|
},
|
354
353
|
)
|
355
|
-
if isinstance(result, GraphQLIncrementalExecutionResults):
|
356
|
-
|
357
|
-
async def stream() -> AsyncGenerator[str, None]:
|
358
|
-
yield "---"
|
359
|
-
|
360
|
-
response = await self.process_result(request, result.initial_result)
|
361
|
-
|
362
|
-
response["hasNext"] = result.initial_result.has_next
|
363
|
-
response["pending"] = [
|
364
|
-
p.formatted for p in result.initial_result.pending
|
365
|
-
]
|
366
|
-
response["extensions"] = result.initial_result.extensions
|
367
|
-
|
368
|
-
yield self.encode_multipart_data(response, "-")
|
369
|
-
|
370
|
-
all_pending = result.initial_result.pending
|
371
|
-
|
372
|
-
async for value in result.subsequent_results:
|
373
|
-
response = {
|
374
|
-
"hasNext": value.has_next,
|
375
|
-
"extensions": value.extensions,
|
376
|
-
}
|
377
|
-
|
378
|
-
if value.pending:
|
379
|
-
response["pending"] = [p.formatted for p in value.pending]
|
380
|
-
|
381
|
-
if value.completed:
|
382
|
-
response["completed"] = [p.formatted for p in value.completed]
|
383
|
-
|
384
|
-
if value.incremental:
|
385
|
-
incremental = []
|
386
|
-
|
387
|
-
all_pending.extend(value.pending)
|
388
|
-
|
389
|
-
for incremental_value in value.incremental:
|
390
|
-
pending_value = next(
|
391
|
-
(
|
392
|
-
v
|
393
|
-
for v in all_pending
|
394
|
-
if v.id == incremental_value.id
|
395
|
-
),
|
396
|
-
None,
|
397
|
-
)
|
398
|
-
|
399
|
-
assert pending_value
|
400
|
-
|
401
|
-
incremental.append(
|
402
|
-
{
|
403
|
-
**incremental_value.formatted,
|
404
|
-
"path": pending_value.path,
|
405
|
-
"label": pending_value.label,
|
406
|
-
}
|
407
|
-
)
|
408
|
-
|
409
|
-
response["incremental"] = incremental
|
410
|
-
|
411
|
-
yield self.encode_multipart_data(response, "-")
|
412
|
-
|
413
|
-
yield "--\r\n"
|
414
|
-
|
415
|
-
return await self.create_streaming_response(
|
416
|
-
request,
|
417
|
-
stream,
|
418
|
-
sub_response,
|
419
|
-
headers={
|
420
|
-
"Transfer-Encoding": "chunked",
|
421
|
-
"Content-Type": 'multipart/mixed; boundary="-"',
|
422
|
-
},
|
423
|
-
)
|
424
354
|
|
425
355
|
response_data = await self.process_result(request=request, result=result)
|
426
356
|
|
@@ -432,16 +362,12 @@ class AsyncBaseHTTPView(
|
|
432
362
|
)
|
433
363
|
|
434
364
|
def encode_multipart_data(self, data: Any, separator: str) -> str:
|
435
|
-
encoded_data = self.encode_json(data)
|
436
|
-
|
437
365
|
return "".join(
|
438
366
|
[
|
439
|
-
"\r\n",
|
440
|
-
"Content-Type: application/json
|
441
|
-
|
442
|
-
"\
|
443
|
-
encoded_data,
|
444
|
-
f"\r\n--{separator}",
|
367
|
+
f"\r\n--{separator}\r\n",
|
368
|
+
"Content-Type: application/json\r\n\r\n",
|
369
|
+
self.encode_json(data),
|
370
|
+
"\n",
|
445
371
|
]
|
446
372
|
)
|
447
373
|
|
@@ -548,6 +474,7 @@ class AsyncBaseHTTPView(
|
|
548
474
|
query=data.get("query"),
|
549
475
|
variables=data.get("variables"),
|
550
476
|
operation_name=data.get("operationName"),
|
477
|
+
extensions=data.get("extensions"),
|
551
478
|
protocol=protocol,
|
552
479
|
)
|
553
480
|
|
{strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/http/base.py
RENAMED
@@ -59,6 +59,12 @@ class BaseView(Generic[Request]):
|
|
59
59
|
if variables:
|
60
60
|
params["variables"] = self.parse_json(variables)
|
61
61
|
|
62
|
+
if "extensions" in params:
|
63
|
+
extensions = params["extensions"]
|
64
|
+
|
65
|
+
if extensions:
|
66
|
+
params["extensions"] = self.parse_json(extensions)
|
67
|
+
|
62
68
|
return params
|
63
69
|
|
64
70
|
@property
|
@@ -122,6 +122,7 @@ class SyncBaseHTTPView(
|
|
122
122
|
context_value=context,
|
123
123
|
operation_name=request_data.operation_name,
|
124
124
|
allowed_operation_types=allowed_operation_types,
|
125
|
+
operation_extensions=request_data.extensions,
|
125
126
|
)
|
126
127
|
|
127
128
|
def parse_multipart(self, request: SyncHTTPRequestAdapter) -> dict[str, str]:
|
@@ -154,6 +155,7 @@ class SyncBaseHTTPView(
|
|
154
155
|
query=data.get("query"),
|
155
156
|
variables=data.get("variables"),
|
156
157
|
operation_name=data.get("operationName"),
|
158
|
+
extensions=data.get("extensions"),
|
157
159
|
)
|
158
160
|
|
159
161
|
def _handle_errors(
|
@@ -561,9 +561,9 @@ def print_schema_definition(
|
|
561
561
|
def print_directive(
|
562
562
|
directive: GraphQLDirective, *, schema: BaseSchema
|
563
563
|
) -> Optional[str]:
|
564
|
-
strawberry_directive = directive.extensions
|
564
|
+
strawberry_directive = directive.extensions["strawberry-definition"]
|
565
565
|
|
566
|
-
if
|
566
|
+
if (
|
567
567
|
isinstance(strawberry_directive, StrawberrySchemaDirective)
|
568
568
|
and not strawberry_directive.print_definition
|
569
569
|
):
|
@@ -621,14 +621,6 @@ def print_schema(schema: BaseSchema) -> str:
|
|
621
621
|
if (printed_directive := print_directive(directive, schema=schema)) is not None
|
622
622
|
]
|
623
623
|
|
624
|
-
if schema.config.enable_experimental_incremental_execution:
|
625
|
-
directives.append(
|
626
|
-
"directive @defer(if: Boolean, label: String) on FRAGMENT_SPREAD | INLINE_FRAGMENT"
|
627
|
-
)
|
628
|
-
directives.append(
|
629
|
-
"directive @stream(if: Boolean, label: String, initialCount: Int = 0) on FIELD"
|
630
|
-
)
|
631
|
-
|
632
624
|
def _name_getter(type_: Any) -> str:
|
633
625
|
if hasattr(type_, "name"):
|
634
626
|
return type_.name
|
@@ -0,0 +1,216 @@
|
|
1
|
+
import asyncio
|
2
|
+
import warnings
|
3
|
+
from collections.abc import AsyncGenerator, Mapping, Sequence
|
4
|
+
from datetime import timedelta
|
5
|
+
from json.decoder import JSONDecodeError
|
6
|
+
from typing import TYPE_CHECKING, Callable, ClassVar, Optional, Union, cast
|
7
|
+
from typing_extensions import TypeGuard
|
8
|
+
|
9
|
+
from quart import Request, Response, Websocket, request, websocket
|
10
|
+
from quart.ctx import has_websocket_context
|
11
|
+
from quart.views import View
|
12
|
+
from strawberry.http.async_base_view import (
|
13
|
+
AsyncBaseHTTPView,
|
14
|
+
AsyncHTTPRequestAdapter,
|
15
|
+
AsyncWebSocketAdapter,
|
16
|
+
)
|
17
|
+
from strawberry.http.exceptions import (
|
18
|
+
HTTPException,
|
19
|
+
NonJsonMessageReceived,
|
20
|
+
NonTextMessageReceived,
|
21
|
+
WebSocketDisconnected,
|
22
|
+
)
|
23
|
+
from strawberry.http.ides import GraphQL_IDE
|
24
|
+
from strawberry.http.types import FormData, HTTPMethod, QueryParams
|
25
|
+
from strawberry.http.typevars import Context, RootValue
|
26
|
+
from strawberry.subscriptions import GRAPHQL_TRANSPORT_WS_PROTOCOL, GRAPHQL_WS_PROTOCOL
|
27
|
+
|
28
|
+
if TYPE_CHECKING:
|
29
|
+
from quart.typing import ResponseReturnValue
|
30
|
+
from strawberry.http import GraphQLHTTPResponse
|
31
|
+
from strawberry.schema.base import BaseSchema
|
32
|
+
|
33
|
+
|
34
|
+
class QuartHTTPRequestAdapter(AsyncHTTPRequestAdapter):
|
35
|
+
def __init__(self, request: Request) -> None:
|
36
|
+
self.request = request
|
37
|
+
|
38
|
+
@property
|
39
|
+
def query_params(self) -> QueryParams:
|
40
|
+
return self.request.args.to_dict()
|
41
|
+
|
42
|
+
@property
|
43
|
+
def method(self) -> HTTPMethod:
|
44
|
+
return cast("HTTPMethod", self.request.method.upper())
|
45
|
+
|
46
|
+
@property
|
47
|
+
def content_type(self) -> Optional[str]:
|
48
|
+
return self.request.content_type
|
49
|
+
|
50
|
+
@property
|
51
|
+
def headers(self) -> Mapping[str, str]:
|
52
|
+
return self.request.headers # type: ignore
|
53
|
+
|
54
|
+
async def get_body(self) -> str:
|
55
|
+
return (await self.request.data).decode()
|
56
|
+
|
57
|
+
async def get_form_data(self) -> FormData:
|
58
|
+
files = await self.request.files
|
59
|
+
form = await self.request.form
|
60
|
+
return FormData(files=files, form=form)
|
61
|
+
|
62
|
+
|
63
|
+
class QuartWebSocketAdapter(AsyncWebSocketAdapter):
|
64
|
+
def __init__(
|
65
|
+
self, view: AsyncBaseHTTPView, request: Websocket, response: Response
|
66
|
+
) -> None:
|
67
|
+
super().__init__(view)
|
68
|
+
self.ws = request
|
69
|
+
|
70
|
+
async def iter_json(
|
71
|
+
self, *, ignore_parsing_errors: bool = False
|
72
|
+
) -> AsyncGenerator[object, None]:
|
73
|
+
try:
|
74
|
+
while True:
|
75
|
+
# Raises asyncio.CancelledError when the connection is closed.
|
76
|
+
# https://quart.palletsprojects.com/en/latest/how_to_guides/websockets.html#detecting-disconnection
|
77
|
+
message = await self.ws.receive()
|
78
|
+
|
79
|
+
if not isinstance(message, str):
|
80
|
+
raise NonTextMessageReceived
|
81
|
+
|
82
|
+
try:
|
83
|
+
yield self.view.decode_json(message)
|
84
|
+
except JSONDecodeError as e:
|
85
|
+
if not ignore_parsing_errors:
|
86
|
+
raise NonJsonMessageReceived from e
|
87
|
+
except asyncio.CancelledError:
|
88
|
+
pass
|
89
|
+
|
90
|
+
async def send_json(self, message: Mapping[str, object]) -> None:
|
91
|
+
try:
|
92
|
+
# Raises asyncio.CancelledError when the connection is closed.
|
93
|
+
# https://quart.palletsprojects.com/en/latest/how_to_guides/websockets.html#detecting-disconnection
|
94
|
+
await self.ws.send(self.view.encode_json(message))
|
95
|
+
except asyncio.CancelledError as exc:
|
96
|
+
raise WebSocketDisconnected from exc
|
97
|
+
|
98
|
+
async def close(self, code: int, reason: str) -> None:
|
99
|
+
await self.ws.close(code, reason=reason)
|
100
|
+
|
101
|
+
|
102
|
+
class GraphQLView(
|
103
|
+
AsyncBaseHTTPView[
|
104
|
+
Request, Response, Response, Websocket, Response, Context, RootValue
|
105
|
+
],
|
106
|
+
View,
|
107
|
+
):
|
108
|
+
methods: ClassVar[list[str]] = ["GET", "POST"]
|
109
|
+
allow_queries_via_get: bool = True
|
110
|
+
request_adapter_class = QuartHTTPRequestAdapter
|
111
|
+
websocket_adapter_class = QuartWebSocketAdapter
|
112
|
+
|
113
|
+
def __init__(
|
114
|
+
self,
|
115
|
+
schema: "BaseSchema",
|
116
|
+
graphiql: Optional[bool] = None,
|
117
|
+
graphql_ide: Optional[GraphQL_IDE] = "graphiql",
|
118
|
+
allow_queries_via_get: bool = True,
|
119
|
+
keep_alive: bool = True,
|
120
|
+
keep_alive_interval: float = 1,
|
121
|
+
debug: bool = False,
|
122
|
+
subscription_protocols: Sequence[str] = (
|
123
|
+
GRAPHQL_TRANSPORT_WS_PROTOCOL,
|
124
|
+
GRAPHQL_WS_PROTOCOL,
|
125
|
+
),
|
126
|
+
connection_init_wait_timeout: timedelta = timedelta(minutes=1),
|
127
|
+
multipart_uploads_enabled: bool = False,
|
128
|
+
) -> None:
|
129
|
+
self.schema = schema
|
130
|
+
self.allow_queries_via_get = allow_queries_via_get
|
131
|
+
self.keep_alive = keep_alive
|
132
|
+
self.keep_alive_interval = keep_alive_interval
|
133
|
+
self.debug = debug
|
134
|
+
self.subscription_protocols = subscription_protocols
|
135
|
+
self.connection_init_wait_timeout = connection_init_wait_timeout
|
136
|
+
self.multipart_uploads_enabled = multipart_uploads_enabled
|
137
|
+
|
138
|
+
if graphiql is not None:
|
139
|
+
warnings.warn(
|
140
|
+
"The `graphiql` argument is deprecated in favor of `graphql_ide`",
|
141
|
+
DeprecationWarning,
|
142
|
+
stacklevel=2,
|
143
|
+
)
|
144
|
+
self.graphql_ide = "graphiql" if graphiql else None
|
145
|
+
else:
|
146
|
+
self.graphql_ide = graphql_ide
|
147
|
+
|
148
|
+
async def render_graphql_ide(self, request: Request) -> Response:
|
149
|
+
return Response(self.graphql_ide_html)
|
150
|
+
|
151
|
+
def create_response(
|
152
|
+
self, response_data: "GraphQLHTTPResponse", sub_response: Response
|
153
|
+
) -> Response:
|
154
|
+
sub_response.set_data(self.encode_json(response_data))
|
155
|
+
|
156
|
+
return sub_response
|
157
|
+
|
158
|
+
async def get_context(
|
159
|
+
self, request: Union[Request, Websocket], response: Response
|
160
|
+
) -> Context:
|
161
|
+
return {"request": request, "response": response} # type: ignore
|
162
|
+
|
163
|
+
async def get_root_value(
|
164
|
+
self, request: Union[Request, Websocket]
|
165
|
+
) -> Optional[RootValue]:
|
166
|
+
return None
|
167
|
+
|
168
|
+
async def get_sub_response(self, request: Request) -> Response:
|
169
|
+
return Response(status=200, content_type="application/json")
|
170
|
+
|
171
|
+
async def dispatch_request(self, **kwargs: object) -> "ResponseReturnValue":
|
172
|
+
try:
|
173
|
+
return await self.run(
|
174
|
+
request=websocket if has_websocket_context() else request
|
175
|
+
)
|
176
|
+
except HTTPException as e:
|
177
|
+
return Response(
|
178
|
+
response=e.reason,
|
179
|
+
status=e.status_code,
|
180
|
+
)
|
181
|
+
|
182
|
+
async def create_streaming_response(
|
183
|
+
self,
|
184
|
+
request: Request,
|
185
|
+
stream: Callable[[], AsyncGenerator[str, None]],
|
186
|
+
sub_response: Response,
|
187
|
+
headers: dict[str, str],
|
188
|
+
) -> Response:
|
189
|
+
return (
|
190
|
+
stream(),
|
191
|
+
sub_response.status_code,
|
192
|
+
{ # type: ignore
|
193
|
+
**sub_response.headers,
|
194
|
+
**headers,
|
195
|
+
},
|
196
|
+
)
|
197
|
+
|
198
|
+
def is_websocket_request(
|
199
|
+
self, request: Union[Request, Websocket]
|
200
|
+
) -> TypeGuard[Websocket]:
|
201
|
+
return has_websocket_context()
|
202
|
+
|
203
|
+
async def pick_websocket_subprotocol(self, request: Websocket) -> Optional[str]:
|
204
|
+
protocols = request.requested_subprotocols
|
205
|
+
intersection = set(protocols) & set(self.subscription_protocols)
|
206
|
+
sorted_intersection = sorted(intersection, key=protocols.index)
|
207
|
+
return next(iter(sorted_intersection), None)
|
208
|
+
|
209
|
+
async def create_websocket_response(
|
210
|
+
self, request: Websocket, subprotocol: Optional[str]
|
211
|
+
) -> Response:
|
212
|
+
await request.accept(subprotocol=subprotocol)
|
213
|
+
return Response()
|
214
|
+
|
215
|
+
|
216
|
+
__all__ = ["GraphQLView"]
|
{strawberry_graphql-0.269.0.dev1746905409 → strawberry_graphql-0.270.0}/strawberry/schema/base.py
RENAMED
@@ -47,6 +47,7 @@ class BaseSchema(Protocol):
|
|
47
47
|
root_value: Optional[Any] = None,
|
48
48
|
operation_name: Optional[str] = None,
|
49
49
|
allowed_operation_types: Optional[Iterable[OperationType]] = None,
|
50
|
+
operation_extensions: Optional[dict[str, Any]] = None,
|
50
51
|
) -> ExecutionResult:
|
51
52
|
raise NotImplementedError
|
52
53
|
|
@@ -59,6 +60,7 @@ class BaseSchema(Protocol):
|
|
59
60
|
root_value: Optional[Any] = None,
|
60
61
|
operation_name: Optional[str] = None,
|
61
62
|
allowed_operation_types: Optional[Iterable[OperationType]] = None,
|
63
|
+
operation_extensions: Optional[dict[str, Any]] = None,
|
62
64
|
) -> ExecutionResult:
|
63
65
|
raise NotImplementedError
|
64
66
|
|
@@ -70,6 +72,7 @@ class BaseSchema(Protocol):
|
|
70
72
|
context_value: Optional[Any] = None,
|
71
73
|
root_value: Optional[Any] = None,
|
72
74
|
operation_name: Optional[str] = None,
|
75
|
+
operation_extensions: Optional[dict[str, Any]] = None,
|
73
76
|
) -> SubscriptionResult:
|
74
77
|
raise NotImplementedError
|
75
78
|
|