strawberry-graphql 0.249.0__tar.gz → 0.250.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.249.0 → strawberry_graphql-0.250.0}/PKG-INFO +1 -1
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/pyproject.toml +1 -1
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/channels/testing.py +26 -33
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/permission.py +1 -2
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/subscriptions/protocols/graphql_transport_ws/handlers.py +60 -69
- strawberry_graphql-0.250.0/strawberry/subscriptions/protocols/graphql_transport_ws/types.py +101 -0
- strawberry_graphql-0.249.0/strawberry/subscriptions/protocols/graphql_transport_ws/types.py +0 -117
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/LICENSE +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/README.md +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/__main__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/aiohttp/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/aiohttp/test/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/aiohttp/test/client.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/aiohttp/views.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/annotation.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/asgi/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/asgi/test/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/asgi/test/client.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/chalice/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/chalice/views.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/channels/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/channels/handlers/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/channels/handlers/base.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/channels/handlers/http_handler.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/channels/handlers/ws_handler.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/channels/router.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/cli/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/cli/app.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/cli/commands/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/cli/commands/codegen.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/cli/commands/export_schema.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/cli/commands/schema_codegen.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/cli/commands/server.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/cli/commands/upgrade/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/cli/commands/upgrade/_fake_progress.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/cli/commands/upgrade/_run_codemod.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/cli/constants.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/cli/debug_server.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/cli/utils/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/cli/utils/load_schema.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/codegen/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/codegen/exceptions.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/codegen/plugins/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/codegen/plugins/print_operation.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/codegen/plugins/python.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/codegen/plugins/typescript.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/codegen/query_codegen.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/codegen/types.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/codemods/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/codemods/annotated_unions.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/codemods/update_imports.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/dataloader.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/directive.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/django/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/django/apps.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/django/context.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/django/test/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/django/test/client.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/django/views.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/exceptions/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/exceptions/conflicting_arguments.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/exceptions/duplicated_type_name.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/exceptions/exception.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/exceptions/exception_source.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/exceptions/handler.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/exceptions/invalid_argument_type.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/exceptions/invalid_union_type.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/exceptions/missing_arguments_annotations.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/exceptions/missing_dependencies.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/exceptions/missing_field_annotation.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/exceptions/missing_return_annotation.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/exceptions/object_is_not_a_class.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/exceptions/object_is_not_an_enum.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/exceptions/permission_fail_silently_requires_optional.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/exceptions/private_strawberry_field.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/exceptions/scalar_already_registered.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/exceptions/syntax.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/exceptions/unresolved_field_type.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/exceptions/utils/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/exceptions/utils/source_finder.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/experimental/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/experimental/pydantic/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/experimental/pydantic/_compat.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/experimental/pydantic/conversion.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/experimental/pydantic/conversion_types.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/experimental/pydantic/error_type.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/experimental/pydantic/exceptions.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/experimental/pydantic/fields.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/experimental/pydantic/object_type.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/experimental/pydantic/utils.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/ext/LICENSE +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/ext/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/ext/dataclasses/LICENSE +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/ext/dataclasses/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/ext/dataclasses/dataclasses.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/ext/mypy_plugin.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/extensions/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/extensions/add_validation_rules.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/extensions/base_extension.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/extensions/context.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/extensions/directives.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/extensions/disable_validation.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/extensions/field_extension.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/extensions/mask_errors.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/extensions/max_aliases.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/extensions/max_tokens.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/extensions/parser_cache.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/extensions/pyinstrument.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/extensions/query_depth_limiter.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/extensions/runner.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/extensions/tracing/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/extensions/tracing/apollo.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/extensions/tracing/datadog.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/extensions/tracing/opentelemetry.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/extensions/tracing/utils.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/extensions/utils.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/extensions/validation_cache.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/fastapi/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/fastapi/context.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/fastapi/router.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/federation/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/federation/argument.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/federation/enum.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/federation/field.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/federation/mutation.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/federation/object_type.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/federation/scalar.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/federation/schema.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/federation/schema_directive.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/federation/schema_directives.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/federation/types.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/federation/union.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/field_extensions/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/field_extensions/input_mutation.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/file_uploads/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/file_uploads/scalars.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/file_uploads/utils.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/flask/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/flask/views.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/http/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/http/async_base_view.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/http/base.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/http/exceptions.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/http/ides.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/http/parse_content_type.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/http/sync_base_view.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/http/temporal_response.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/http/types.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/http/typevars.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/litestar/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/litestar/controller.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/parent.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/printer/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/printer/ast_from_value.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/printer/printer.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/py.typed +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/quart/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/quart/views.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/relay/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/relay/exceptions.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/relay/fields.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/relay/types.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/relay/utils.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/resolvers.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/sanic/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/sanic/context.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/sanic/utils.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/sanic/views.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/scalars.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/schema/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/schema/base.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/schema/compat.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/schema/config.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/schema/exceptions.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/schema/execute.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/schema/name_converter.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/schema/schema.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/schema/schema_converter.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/schema/subscribe.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/schema/types/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/schema/types/base_scalars.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/schema/types/concrete_type.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/schema/types/scalar.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/schema/validation_rules/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/schema/validation_rules/one_of.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/schema_codegen/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/schema_directive.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/schema_directives.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/static/apollo-sandbox.html +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/static/graphiql.html +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/static/pathfinder.html +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/subscriptions/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/subscriptions/protocols/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/subscriptions/protocols/graphql_transport_ws/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/subscriptions/protocols/graphql_ws/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/subscriptions/protocols/graphql_ws/handlers.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/subscriptions/protocols/graphql_ws/types.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/test/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/test/client.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/tools/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/tools/create_type.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/tools/merge_types.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/types/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/types/arguments.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/types/auto.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/types/base.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/types/enum.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/types/execution.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/types/field.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/types/fields/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/types/fields/resolver.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/types/graphql.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/types/info.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/types/lazy_type.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/types/mutation.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/types/nodes.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/types/object_type.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/types/private.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/types/scalar.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/types/type_resolver.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/types/union.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/types/unset.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/utils/__init__.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/utils/aio.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/utils/await_maybe.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/utils/dataclasses.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/utils/debug.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/utils/deprecations.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/utils/graphql_lexer.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/utils/importer.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/utils/inspect.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/utils/logging.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/utils/operation.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/utils/str_converters.py +0 -0
- {strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/utils/typing.py +0 -0
@@ -17,23 +17,10 @@ from graphql import GraphQLError, GraphQLFormattedError
|
|
17
17
|
|
18
18
|
from channels.testing.websocket import WebsocketCommunicator
|
19
19
|
from strawberry.subscriptions import GRAPHQL_TRANSPORT_WS_PROTOCOL, GRAPHQL_WS_PROTOCOL
|
20
|
-
from strawberry.subscriptions.protocols.graphql_transport_ws
|
21
|
-
|
22
|
-
ConnectionInitMessage,
|
23
|
-
ErrorMessage,
|
24
|
-
NextMessage,
|
25
|
-
SubscribeMessage,
|
26
|
-
SubscribeMessagePayload,
|
27
|
-
)
|
28
|
-
from strawberry.subscriptions.protocols.graphql_ws.types import (
|
29
|
-
ConnectionAckMessage as GraphQLWSConnectionAckMessage,
|
30
|
-
)
|
31
|
-
from strawberry.subscriptions.protocols.graphql_ws.types import (
|
32
|
-
ConnectionInitMessage as GraphQLWSConnectionInitMessage,
|
33
|
-
)
|
34
|
-
from strawberry.subscriptions.protocols.graphql_ws.types import (
|
35
|
-
StartMessage as GraphQLWSStartMessage,
|
20
|
+
from strawberry.subscriptions.protocols.graphql_transport_ws import (
|
21
|
+
types as transport_ws_types,
|
36
22
|
)
|
23
|
+
from strawberry.subscriptions.protocols.graphql_ws import types as ws_types
|
37
24
|
from strawberry.types import ExecutionResult
|
38
25
|
|
39
26
|
if TYPE_CHECKING:
|
@@ -109,19 +96,21 @@ class GraphQLWebsocketCommunicator(WebsocketCommunicator):
|
|
109
96
|
if self.protocol == GRAPHQL_TRANSPORT_WS_PROTOCOL:
|
110
97
|
assert res == (True, GRAPHQL_TRANSPORT_WS_PROTOCOL)
|
111
98
|
await self.send_json_to(
|
112
|
-
ConnectionInitMessage(
|
99
|
+
transport_ws_types.ConnectionInitMessage(
|
100
|
+
{"type": "connection_init", "payload": self.connection_params}
|
101
|
+
)
|
113
102
|
)
|
114
|
-
|
115
|
-
assert
|
103
|
+
transport_ws_connection_ack_message: transport_ws_types.ConnectionAckMessage = await self.receive_json_from()
|
104
|
+
assert transport_ws_connection_ack_message == {"type": "connection_ack"}
|
116
105
|
else:
|
117
106
|
assert res == (True, GRAPHQL_WS_PROTOCOL)
|
118
107
|
await self.send_json_to(
|
119
|
-
|
108
|
+
ws_types.ConnectionInitMessage({"type": "connection_init"})
|
120
109
|
)
|
121
|
-
|
110
|
+
ws_connection_ack_message: ws_types.ConnectionAckMessage = (
|
122
111
|
await self.receive_json_from()
|
123
112
|
)
|
124
|
-
assert
|
113
|
+
assert ws_connection_ack_message["type"] == "connection_ack"
|
125
114
|
|
126
115
|
# Actual `ExecutionResult`` objects are not available client-side, since they
|
127
116
|
# get transformed into `FormattedExecutionResult` on the wire, but we attempt
|
@@ -133,13 +122,16 @@ class GraphQLWebsocketCommunicator(WebsocketCommunicator):
|
|
133
122
|
|
134
123
|
if self.protocol == GRAPHQL_TRANSPORT_WS_PROTOCOL:
|
135
124
|
await self.send_json_to(
|
136
|
-
SubscribeMessage(
|
137
|
-
|
138
|
-
|
139
|
-
|
125
|
+
transport_ws_types.SubscribeMessage(
|
126
|
+
{
|
127
|
+
"id": id_,
|
128
|
+
"type": "subscribe",
|
129
|
+
"payload": {"query": query, "variables": variables},
|
130
|
+
}
|
131
|
+
)
|
140
132
|
)
|
141
133
|
else:
|
142
|
-
start_message:
|
134
|
+
start_message: ws_types.StartMessage = {
|
143
135
|
"type": "start",
|
144
136
|
"id": id_,
|
145
137
|
"payload": {
|
@@ -153,17 +145,18 @@ class GraphQLWebsocketCommunicator(WebsocketCommunicator):
|
|
153
145
|
await self.send_json_to(start_message)
|
154
146
|
|
155
147
|
while True:
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
148
|
+
message: transport_ws_types.Message = await self.receive_json_from(
|
149
|
+
timeout=5
|
150
|
+
)
|
151
|
+
if message["type"] == "next":
|
152
|
+
payload = message["payload"]
|
160
153
|
ret = ExecutionResult(payload.get("data"), None)
|
161
154
|
if "errors" in payload:
|
162
155
|
ret.errors = self.process_errors(payload.get("errors") or [])
|
163
156
|
ret.extensions = payload.get("extensions", None)
|
164
157
|
yield ret
|
165
|
-
elif
|
166
|
-
error_payload =
|
158
|
+
elif message["type"] == "error":
|
159
|
+
error_payload = message["payload"]
|
167
160
|
yield ExecutionResult(
|
168
161
|
data=None, errors=self.process_errors(error_payload)
|
169
162
|
)
|
@@ -177,8 +177,7 @@ class PermissionExtension(FieldExtension):
|
|
177
177
|
elif isinstance(field.type, StrawberryList):
|
178
178
|
self.return_empty_list = True
|
179
179
|
else:
|
180
|
-
|
181
|
-
raise errror
|
180
|
+
raise PermissionFailSilentlyRequiresOptionalError(field)
|
182
181
|
|
183
182
|
def _on_unauthorized(self, permission: BasePermission) -> Any:
|
184
183
|
if self.fail_silently:
|
@@ -5,11 +5,11 @@ import logging
|
|
5
5
|
from contextlib import suppress
|
6
6
|
from typing import (
|
7
7
|
TYPE_CHECKING,
|
8
|
-
Any,
|
9
8
|
Awaitable,
|
10
9
|
Dict,
|
11
10
|
List,
|
12
11
|
Optional,
|
12
|
+
cast,
|
13
13
|
)
|
14
14
|
|
15
15
|
from graphql import GraphQLError, GraphQLSyntaxError, parse
|
@@ -21,20 +21,16 @@ from strawberry.http.exceptions import (
|
|
21
21
|
)
|
22
22
|
from strawberry.subscriptions.protocols.graphql_transport_ws.types import (
|
23
23
|
CompleteMessage,
|
24
|
-
ConnectionAckMessage,
|
25
24
|
ConnectionInitMessage,
|
26
|
-
|
27
|
-
|
28
|
-
NextPayload,
|
25
|
+
Message,
|
26
|
+
NextMessagePayload,
|
29
27
|
PingMessage,
|
30
28
|
PongMessage,
|
31
29
|
SubscribeMessage,
|
32
|
-
SubscribeMessagePayload,
|
33
30
|
)
|
34
31
|
from strawberry.types import ExecutionResult
|
35
32
|
from strawberry.types.execution import PreExecutionError
|
36
33
|
from strawberry.types.graphql import OperationType
|
37
|
-
from strawberry.types.unset import UNSET
|
38
34
|
from strawberry.utils.debug import pretty_print_graphql_operation
|
39
35
|
from strawberry.utils.operation import get_operation_type
|
40
36
|
|
@@ -44,9 +40,6 @@ if TYPE_CHECKING:
|
|
44
40
|
from strawberry.http.async_base_view import AsyncWebSocketAdapter
|
45
41
|
from strawberry.schema import BaseSchema
|
46
42
|
from strawberry.schema.subscribe import SubscriptionResult
|
47
|
-
from strawberry.subscriptions.protocols.graphql_transport_ws.types import (
|
48
|
-
GraphQLTransportMessage,
|
49
|
-
)
|
50
43
|
|
51
44
|
|
52
45
|
class BaseGraphQLTransportWSHandler:
|
@@ -73,15 +66,15 @@ class BaseGraphQLTransportWSHandler:
|
|
73
66
|
self.connection_timed_out = False
|
74
67
|
self.operations: Dict[str, Operation] = {}
|
75
68
|
self.completed_tasks: List[asyncio.Task] = []
|
76
|
-
self.connection_params: Optional[Dict[str,
|
69
|
+
self.connection_params: Optional[Dict[str, object]] = None
|
77
70
|
|
78
|
-
async def handle(self) ->
|
71
|
+
async def handle(self) -> None:
|
79
72
|
self.on_request_accepted()
|
80
73
|
|
81
74
|
try:
|
82
75
|
try:
|
83
76
|
async for message in self.websocket.iter_json():
|
84
|
-
await self.handle_message(message)
|
77
|
+
await self.handle_message(cast(Message, message))
|
85
78
|
except NonTextMessageReceived:
|
86
79
|
await self.handle_invalid_message("WebSocket message type must be text")
|
87
80
|
except NonJsonMessageReceived:
|
@@ -134,39 +127,28 @@ class BaseGraphQLTransportWSHandler:
|
|
134
127
|
async def handle_task_exception(self, error: Exception) -> None: # pragma: no cover
|
135
128
|
self.task_logger.exception("Exception in worker task", exc_info=error)
|
136
129
|
|
137
|
-
async def handle_message(self, message:
|
130
|
+
async def handle_message(self, message: Message) -> None:
|
138
131
|
try:
|
139
|
-
|
132
|
+
if message["type"] == "connection_init":
|
133
|
+
await self.handle_connection_init(message)
|
140
134
|
|
141
|
-
|
142
|
-
await self.
|
135
|
+
elif message["type"] == "ping":
|
136
|
+
await self.handle_ping(message)
|
143
137
|
|
144
|
-
elif
|
145
|
-
await self.
|
138
|
+
elif message["type"] == "pong":
|
139
|
+
await self.handle_pong(message)
|
146
140
|
|
147
|
-
elif
|
148
|
-
await self.
|
141
|
+
elif message["type"] == "subscribe":
|
142
|
+
await self.handle_subscribe(message)
|
149
143
|
|
150
|
-
elif
|
151
|
-
|
152
|
-
payload = SubscribeMessagePayload(
|
153
|
-
query=payload_args["query"],
|
154
|
-
operationName=payload_args.get("operationName"),
|
155
|
-
variables=payload_args.get("variables"),
|
156
|
-
extensions=payload_args.get("extensions"),
|
157
|
-
)
|
158
|
-
await self.handle_subscribe(
|
159
|
-
SubscribeMessage(payload=payload, **message)
|
160
|
-
)
|
161
|
-
|
162
|
-
elif message_type == CompleteMessage.type:
|
163
|
-
await self.handle_complete(CompleteMessage(**message))
|
144
|
+
elif message["type"] == "complete":
|
145
|
+
await self.handle_complete(message)
|
164
146
|
|
165
147
|
else:
|
166
|
-
error_message = f"Unknown message type: {
|
148
|
+
error_message = f"Unknown message type: {message['type']}"
|
167
149
|
await self.handle_invalid_message(error_message)
|
168
150
|
|
169
|
-
except
|
151
|
+
except KeyError:
|
170
152
|
await self.handle_invalid_message("Failed to parse message")
|
171
153
|
finally:
|
172
154
|
await self.reap_completed_tasks()
|
@@ -175,14 +157,11 @@ class BaseGraphQLTransportWSHandler:
|
|
175
157
|
if self.connection_timed_out:
|
176
158
|
# No way to reliably excercise this case during testing
|
177
159
|
return # pragma: no cover
|
160
|
+
|
178
161
|
if self.connection_init_timeout_task:
|
179
162
|
self.connection_init_timeout_task.cancel()
|
180
163
|
|
181
|
-
payload = (
|
182
|
-
message.payload
|
183
|
-
if message.payload is not None and message.payload is not UNSET
|
184
|
-
else {}
|
185
|
-
)
|
164
|
+
payload = message.get("payload", {})
|
186
165
|
|
187
166
|
if not isinstance(payload, dict):
|
188
167
|
await self.websocket.close(
|
@@ -198,11 +177,11 @@ class BaseGraphQLTransportWSHandler:
|
|
198
177
|
return
|
199
178
|
|
200
179
|
self.connection_init_received = True
|
201
|
-
await self.send_message(
|
180
|
+
await self.send_message({"type": "connection_ack"})
|
202
181
|
self.connection_acknowledged = True
|
203
182
|
|
204
183
|
async def handle_ping(self, message: PingMessage) -> None:
|
205
|
-
await self.send_message(
|
184
|
+
await self.send_message({"type": "pong"})
|
206
185
|
|
207
186
|
async def handle_pong(self, message: PongMessage) -> None:
|
208
187
|
pass
|
@@ -213,14 +192,14 @@ class BaseGraphQLTransportWSHandler:
|
|
213
192
|
return
|
214
193
|
|
215
194
|
try:
|
216
|
-
graphql_document = parse(message
|
195
|
+
graphql_document = parse(message["payload"]["query"])
|
217
196
|
except GraphQLSyntaxError as exc:
|
218
197
|
await self.websocket.close(code=4400, reason=exc.message)
|
219
198
|
return
|
220
199
|
|
221
200
|
try:
|
222
201
|
operation_type = get_operation_type(
|
223
|
-
graphql_document, message
|
202
|
+
graphql_document, message["payload"].get("operationName")
|
224
203
|
)
|
225
204
|
except RuntimeError:
|
226
205
|
await self.websocket.close(
|
@@ -228,16 +207,16 @@ class BaseGraphQLTransportWSHandler:
|
|
228
207
|
)
|
229
208
|
return
|
230
209
|
|
231
|
-
if message
|
232
|
-
reason = f"Subscriber for {message
|
210
|
+
if message["id"] in self.operations:
|
211
|
+
reason = f"Subscriber for {message['id']} already exists"
|
233
212
|
await self.websocket.close(code=4409, reason=reason)
|
234
213
|
return
|
235
214
|
|
236
215
|
if self.debug: # pragma: no cover
|
237
216
|
pretty_print_graphql_operation(
|
238
|
-
message
|
239
|
-
message
|
240
|
-
message
|
217
|
+
message["payload"].get("operationName"),
|
218
|
+
message["payload"]["query"],
|
219
|
+
message["payload"].get("variables"),
|
241
220
|
)
|
242
221
|
|
243
222
|
if isinstance(self.context, dict):
|
@@ -247,15 +226,15 @@ class BaseGraphQLTransportWSHandler:
|
|
247
226
|
|
248
227
|
operation = Operation(
|
249
228
|
self,
|
250
|
-
message
|
229
|
+
message["id"],
|
251
230
|
operation_type,
|
252
|
-
message
|
253
|
-
message
|
254
|
-
message
|
231
|
+
message["payload"]["query"],
|
232
|
+
message["payload"].get("variables"),
|
233
|
+
message["payload"].get("operationName"),
|
255
234
|
)
|
256
235
|
|
257
236
|
operation.task = asyncio.create_task(self.run_operation(operation))
|
258
|
-
self.operations[message
|
237
|
+
self.operations[message["id"]] = operation
|
259
238
|
|
260
239
|
async def run_operation(self, operation: Operation) -> None:
|
261
240
|
"""The operation task's top level method. Cleans-up and de-registers the operation once it is done."""
|
@@ -291,11 +270,15 @@ class BaseGraphQLTransportWSHandler:
|
|
291
270
|
# that's a mutation / query result
|
292
271
|
elif isinstance(first_res_or_agen, ExecutionResult):
|
293
272
|
await operation.send_next(first_res_or_agen)
|
294
|
-
await operation.
|
273
|
+
await operation.send_operation_message(
|
274
|
+
{"id": operation.id, "type": "complete"}
|
275
|
+
)
|
295
276
|
else:
|
296
277
|
async for result in first_res_or_agen:
|
297
278
|
await operation.send_next(result)
|
298
|
-
await operation.
|
279
|
+
await operation.send_operation_message(
|
280
|
+
{"id": operation.id, "type": "complete"}
|
281
|
+
)
|
299
282
|
|
300
283
|
except BaseException as e: # pragma: no cover
|
301
284
|
self.operations.pop(operation.id, None)
|
@@ -312,14 +295,13 @@ class BaseGraphQLTransportWSHandler:
|
|
312
295
|
del self.operations[id]
|
313
296
|
|
314
297
|
async def handle_complete(self, message: CompleteMessage) -> None:
|
315
|
-
await self.cleanup_operation(operation_id=message
|
298
|
+
await self.cleanup_operation(operation_id=message["id"])
|
316
299
|
|
317
300
|
async def handle_invalid_message(self, error_message: str) -> None:
|
318
301
|
await self.websocket.close(code=4400, reason=error_message)
|
319
302
|
|
320
|
-
async def send_message(self, message:
|
321
|
-
|
322
|
-
await self.websocket.send_json(data)
|
303
|
+
async def send_message(self, message: Message) -> None:
|
304
|
+
await self.websocket.send_json(message)
|
323
305
|
|
324
306
|
async def cleanup_operation(self, operation_id: str) -> None:
|
325
307
|
if operation_id not in self.operations:
|
@@ -358,7 +340,7 @@ class Operation:
|
|
358
340
|
id: str,
|
359
341
|
operation_type: OperationType,
|
360
342
|
query: str,
|
361
|
-
variables: Optional[Dict[str,
|
343
|
+
variables: Optional[Dict[str, object]],
|
362
344
|
operation_name: Optional[str],
|
363
345
|
) -> None:
|
364
346
|
self.handler = handler
|
@@ -370,10 +352,10 @@ class Operation:
|
|
370
352
|
self.completed = False
|
371
353
|
self.task: Optional[asyncio.Task] = None
|
372
354
|
|
373
|
-
async def
|
355
|
+
async def send_operation_message(self, message: Message) -> None:
|
374
356
|
if self.completed:
|
375
357
|
return
|
376
|
-
if
|
358
|
+
if message["type"] == "complete" or message["type"] == "error":
|
377
359
|
self.completed = True
|
378
360
|
# de-register the operation _before_ sending the final message
|
379
361
|
self.handler.forget_id(self.id)
|
@@ -383,17 +365,26 @@ class Operation:
|
|
383
365
|
# Initial errors see https://github.com/enisdenjo/graphql-ws/blob/master/PROTOCOL.md#error
|
384
366
|
# "This can occur before execution starts,
|
385
367
|
# usually due to validation errors, or during the execution of the request"
|
386
|
-
await self.
|
387
|
-
|
368
|
+
await self.send_operation_message(
|
369
|
+
{
|
370
|
+
"id": self.id,
|
371
|
+
"type": "error",
|
372
|
+
"payload": [err.formatted for err in errors],
|
373
|
+
}
|
388
374
|
)
|
389
375
|
|
390
376
|
async def send_next(self, execution_result: ExecutionResult) -> None:
|
391
|
-
next_payload:
|
377
|
+
next_payload: NextMessagePayload = {"data": execution_result.data}
|
378
|
+
|
392
379
|
if execution_result.errors:
|
393
380
|
next_payload["errors"] = [err.formatted for err in execution_result.errors]
|
381
|
+
|
394
382
|
if execution_result.extensions:
|
395
383
|
next_payload["extensions"] = execution_result.extensions
|
396
|
-
|
384
|
+
|
385
|
+
await self.send_operation_message(
|
386
|
+
{"id": self.id, "type": "next", "payload": next_payload}
|
387
|
+
)
|
397
388
|
|
398
389
|
|
399
390
|
__all__ = ["BaseGraphQLTransportWSHandler", "Operation"]
|
@@ -0,0 +1,101 @@
|
|
1
|
+
from typing import Dict, List, TypedDict, Union
|
2
|
+
from typing_extensions import Literal, NotRequired
|
3
|
+
|
4
|
+
from graphql import GraphQLFormattedError
|
5
|
+
|
6
|
+
|
7
|
+
class ConnectionInitMessage(TypedDict):
|
8
|
+
"""Direction: Client -> Server."""
|
9
|
+
|
10
|
+
type: Literal["connection_init"]
|
11
|
+
payload: NotRequired[Union[Dict[str, object], None]]
|
12
|
+
|
13
|
+
|
14
|
+
class ConnectionAckMessage(TypedDict):
|
15
|
+
"""Direction: Server -> Client."""
|
16
|
+
|
17
|
+
type: Literal["connection_ack"]
|
18
|
+
payload: NotRequired[Union[Dict[str, object], None]]
|
19
|
+
|
20
|
+
|
21
|
+
class PingMessage(TypedDict):
|
22
|
+
"""Direction: bidirectional."""
|
23
|
+
|
24
|
+
type: Literal["ping"]
|
25
|
+
payload: NotRequired[Union[Dict[str, object], None]]
|
26
|
+
|
27
|
+
|
28
|
+
class PongMessage(TypedDict):
|
29
|
+
"""Direction: bidirectional."""
|
30
|
+
|
31
|
+
type: Literal["pong"]
|
32
|
+
payload: NotRequired[Union[Dict[str, object], None]]
|
33
|
+
|
34
|
+
|
35
|
+
class SubscribeMessagePayload(TypedDict):
|
36
|
+
operationName: NotRequired[Union[str, None]]
|
37
|
+
query: str
|
38
|
+
variables: NotRequired[Union[Dict[str, object], None]]
|
39
|
+
extensions: NotRequired[Union[Dict[str, object], None]]
|
40
|
+
|
41
|
+
|
42
|
+
class SubscribeMessage(TypedDict):
|
43
|
+
"""Direction: Client -> Server."""
|
44
|
+
|
45
|
+
id: str
|
46
|
+
type: Literal["subscribe"]
|
47
|
+
payload: SubscribeMessagePayload
|
48
|
+
|
49
|
+
|
50
|
+
class NextMessagePayload(TypedDict):
|
51
|
+
errors: NotRequired[List[GraphQLFormattedError]]
|
52
|
+
data: NotRequired[Union[Dict[str, object], None]]
|
53
|
+
extensions: NotRequired[Dict[str, object]]
|
54
|
+
|
55
|
+
|
56
|
+
class NextMessage(TypedDict):
|
57
|
+
"""Direction: Server -> Client."""
|
58
|
+
|
59
|
+
id: str
|
60
|
+
type: Literal["next"]
|
61
|
+
payload: NextMessagePayload
|
62
|
+
|
63
|
+
|
64
|
+
class ErrorMessage(TypedDict):
|
65
|
+
"""Direction: Server -> Client."""
|
66
|
+
|
67
|
+
id: str
|
68
|
+
type: Literal["error"]
|
69
|
+
payload: List[GraphQLFormattedError]
|
70
|
+
|
71
|
+
|
72
|
+
class CompleteMessage(TypedDict):
|
73
|
+
"""Direction: bidirectional."""
|
74
|
+
|
75
|
+
id: str
|
76
|
+
type: Literal["complete"]
|
77
|
+
|
78
|
+
|
79
|
+
Message = Union[
|
80
|
+
ConnectionInitMessage,
|
81
|
+
ConnectionAckMessage,
|
82
|
+
PingMessage,
|
83
|
+
PongMessage,
|
84
|
+
SubscribeMessage,
|
85
|
+
NextMessage,
|
86
|
+
ErrorMessage,
|
87
|
+
CompleteMessage,
|
88
|
+
]
|
89
|
+
|
90
|
+
|
91
|
+
__all__ = [
|
92
|
+
"ConnectionInitMessage",
|
93
|
+
"ConnectionAckMessage",
|
94
|
+
"PingMessage",
|
95
|
+
"PongMessage",
|
96
|
+
"SubscribeMessage",
|
97
|
+
"NextMessage",
|
98
|
+
"ErrorMessage",
|
99
|
+
"CompleteMessage",
|
100
|
+
"Message",
|
101
|
+
]
|
@@ -1,117 +0,0 @@
|
|
1
|
-
from __future__ import annotations
|
2
|
-
|
3
|
-
from dataclasses import asdict, dataclass
|
4
|
-
from typing import TYPE_CHECKING, Any, Dict, List, Optional, TypedDict
|
5
|
-
|
6
|
-
from strawberry.types.unset import UNSET
|
7
|
-
|
8
|
-
if TYPE_CHECKING:
|
9
|
-
from graphql import GraphQLFormattedError
|
10
|
-
|
11
|
-
|
12
|
-
@dataclass
|
13
|
-
class GraphQLTransportMessage:
|
14
|
-
def as_dict(self) -> dict:
|
15
|
-
data = asdict(self)
|
16
|
-
if getattr(self, "payload", None) is UNSET:
|
17
|
-
# Unset fields must have a JSON value of "undefined" not "null"
|
18
|
-
data.pop("payload")
|
19
|
-
return data
|
20
|
-
|
21
|
-
|
22
|
-
@dataclass
|
23
|
-
class ConnectionInitMessage(GraphQLTransportMessage):
|
24
|
-
"""Direction: Client -> Server."""
|
25
|
-
|
26
|
-
payload: Optional[Dict[str, Any]] = UNSET
|
27
|
-
type: str = "connection_init"
|
28
|
-
|
29
|
-
|
30
|
-
@dataclass
|
31
|
-
class ConnectionAckMessage(GraphQLTransportMessage):
|
32
|
-
"""Direction: Server -> Client."""
|
33
|
-
|
34
|
-
payload: Optional[Dict[str, Any]] = UNSET
|
35
|
-
type: str = "connection_ack"
|
36
|
-
|
37
|
-
|
38
|
-
@dataclass
|
39
|
-
class PingMessage(GraphQLTransportMessage):
|
40
|
-
"""Direction: bidirectional."""
|
41
|
-
|
42
|
-
payload: Optional[Dict[str, Any]] = UNSET
|
43
|
-
type: str = "ping"
|
44
|
-
|
45
|
-
|
46
|
-
@dataclass
|
47
|
-
class PongMessage(GraphQLTransportMessage):
|
48
|
-
"""Direction: bidirectional."""
|
49
|
-
|
50
|
-
payload: Optional[Dict[str, Any]] = UNSET
|
51
|
-
type: str = "pong"
|
52
|
-
|
53
|
-
|
54
|
-
@dataclass
|
55
|
-
class SubscribeMessagePayload:
|
56
|
-
query: str
|
57
|
-
operationName: Optional[str] = None
|
58
|
-
variables: Optional[Dict[str, Any]] = None
|
59
|
-
extensions: Optional[Dict[str, Any]] = None
|
60
|
-
|
61
|
-
|
62
|
-
@dataclass
|
63
|
-
class SubscribeMessage(GraphQLTransportMessage):
|
64
|
-
"""Direction: Client -> Server."""
|
65
|
-
|
66
|
-
id: str
|
67
|
-
payload: SubscribeMessagePayload
|
68
|
-
type: str = "subscribe"
|
69
|
-
|
70
|
-
|
71
|
-
class NextPayload(TypedDict, total=False):
|
72
|
-
data: Any
|
73
|
-
|
74
|
-
# Optional list of formatted graphql.GraphQLError objects
|
75
|
-
errors: Optional[List[GraphQLFormattedError]]
|
76
|
-
extensions: Optional[Dict[str, Any]]
|
77
|
-
|
78
|
-
|
79
|
-
@dataclass
|
80
|
-
class NextMessage(GraphQLTransportMessage):
|
81
|
-
"""Direction: Server -> Client."""
|
82
|
-
|
83
|
-
id: str
|
84
|
-
payload: NextPayload
|
85
|
-
type: str = "next"
|
86
|
-
|
87
|
-
def as_dict(self) -> dict:
|
88
|
-
return {"id": self.id, "payload": self.payload, "type": self.type}
|
89
|
-
|
90
|
-
|
91
|
-
@dataclass
|
92
|
-
class ErrorMessage(GraphQLTransportMessage):
|
93
|
-
"""Direction: Server -> Client."""
|
94
|
-
|
95
|
-
id: str
|
96
|
-
payload: List[GraphQLFormattedError]
|
97
|
-
type: str = "error"
|
98
|
-
|
99
|
-
|
100
|
-
@dataclass
|
101
|
-
class CompleteMessage(GraphQLTransportMessage):
|
102
|
-
"""Direction: bidirectional."""
|
103
|
-
|
104
|
-
id: str
|
105
|
-
type: str = "complete"
|
106
|
-
|
107
|
-
|
108
|
-
__all__ = [
|
109
|
-
"ConnectionInitMessage",
|
110
|
-
"ConnectionAckMessage",
|
111
|
-
"PingMessage",
|
112
|
-
"PongMessage",
|
113
|
-
"SubscribeMessage",
|
114
|
-
"NextMessage",
|
115
|
-
"ErrorMessage",
|
116
|
-
"CompleteMessage",
|
117
|
-
]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{strawberry_graphql-0.249.0 → strawberry_graphql-0.250.0}/strawberry/aiohttp/test/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|