strawberry-graphql 0.278.0__tar.gz → 0.278.1__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.278.0 → strawberry_graphql-0.278.1}/PKG-INFO +2 -1
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/pyproject.toml +2 -1
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/aiohttp/views.py +2 -48
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/asgi/__init__.py +2 -37
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/chalice/views.py +4 -39
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/channels/handlers/http_handler.py +30 -6
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/django/views.py +4 -73
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/fastapi/router.py +8 -4
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/flask/views.py +4 -74
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/http/async_base_view.py +5 -31
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/http/base.py +2 -1
- strawberry_graphql-0.278.1/strawberry/http/exceptions.py +17 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/http/sync_base_view.py +1 -34
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/litestar/controller.py +1 -39
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/quart/views.py +3 -33
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/sanic/views.py +4 -43
- strawberry_graphql-0.278.0/strawberry/http/exceptions.py +0 -19
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/LICENSE +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/README.md +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/__main__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/aiohttp/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/aiohttp/test/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/aiohttp/test/client.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/annotation.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/asgi/test/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/asgi/test/client.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/chalice/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/channels/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/channels/handlers/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/channels/handlers/base.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/channels/handlers/ws_handler.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/channels/router.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/channels/testing.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/app.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/commands/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/commands/codegen.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/commands/export_schema.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/commands/locate_definition.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/commands/schema_codegen.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/commands/server.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/commands/upgrade/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/commands/upgrade/_fake_progress.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/commands/upgrade/_run_codemod.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/constants.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/debug_server.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/utils/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/cli/utils/load_schema.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/codegen/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/codegen/exceptions.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/codegen/plugins/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/codegen/plugins/print_operation.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/codegen/plugins/python.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/codegen/plugins/typescript.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/codegen/query_codegen.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/codegen/types.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/codemods/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/codemods/annotated_unions.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/codemods/update_imports.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/dataloader.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/directive.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/django/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/django/apps.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/django/context.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/django/test/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/django/test/client.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/conflicting_arguments.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/duplicated_type_name.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/exception.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/exception_source.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/handler.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/invalid_argument_type.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/invalid_superclass_interface.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/invalid_union_type.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/missing_arguments_annotations.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/missing_dependencies.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/missing_field_annotation.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/missing_return_annotation.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/object_is_not_a_class.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/object_is_not_an_enum.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/permission_fail_silently_requires_optional.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/private_strawberry_field.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/scalar_already_registered.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/syntax.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/unresolved_field_type.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/utils/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/exceptions/utils/source_finder.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/experimental/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/experimental/pydantic/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/experimental/pydantic/_compat.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/experimental/pydantic/conversion.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/experimental/pydantic/conversion_types.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/experimental/pydantic/error_type.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/experimental/pydantic/exceptions.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/experimental/pydantic/fields.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/experimental/pydantic/object_type.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/experimental/pydantic/utils.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/ext/LICENSE +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/ext/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/ext/dataclasses/LICENSE +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/ext/dataclasses/README.md +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/ext/dataclasses/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/ext/dataclasses/dataclasses.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/ext/mypy_plugin.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/add_validation_rules.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/base_extension.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/context.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/directives.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/disable_introspection.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/disable_validation.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/field_extension.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/mask_errors.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/max_aliases.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/max_tokens.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/parser_cache.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/pyinstrument.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/query_depth_limiter.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/runner.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/tracing/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/tracing/apollo.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/tracing/datadog.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/tracing/opentelemetry.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/tracing/utils.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/utils.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/extensions/validation_cache.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/fastapi/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/fastapi/context.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/federation/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/federation/argument.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/federation/enum.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/federation/field.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/federation/mutation.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/federation/object_type.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/federation/scalar.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/federation/schema.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/federation/schema_directive.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/federation/schema_directives.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/federation/types.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/federation/union.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/field_extensions/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/field_extensions/input_mutation.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/file_uploads/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/file_uploads/scalars.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/file_uploads/utils.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/flask/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/http/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/http/ides.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/http/parse_content_type.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/http/temporal_response.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/http/types.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/http/typevars.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/litestar/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/parent.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/permission.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/printer/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/printer/ast_from_value.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/printer/printer.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/py.typed +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/quart/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/relay/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/relay/exceptions.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/relay/fields.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/relay/types.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/relay/utils.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/resolvers.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/sanic/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/sanic/context.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/sanic/utils.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/scalars.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/_graphql_core.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/base.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/compat.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/config.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/exceptions.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/name_converter.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/schema.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/schema_converter.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/types/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/types/base_scalars.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/types/concrete_type.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/types/scalar.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/validation_rules/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema/validation_rules/one_of.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema_codegen/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema_directive.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/schema_directives.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/static/apollo-sandbox.html +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/static/graphiql.html +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/static/pathfinder.html +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/streamable.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/subscriptions/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/subscriptions/protocols/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/subscriptions/protocols/graphql_transport_ws/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/subscriptions/protocols/graphql_transport_ws/handlers.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/subscriptions/protocols/graphql_transport_ws/types.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/subscriptions/protocols/graphql_ws/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/subscriptions/protocols/graphql_ws/handlers.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/subscriptions/protocols/graphql_ws/types.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/test/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/test/client.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/tools/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/tools/create_type.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/tools/merge_types.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/arguments.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/auto.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/base.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/cast.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/enum.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/execution.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/field.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/fields/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/fields/resolver.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/graphql.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/info.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/lazy_type.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/maybe.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/mutation.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/nodes.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/object_type.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/private.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/scalar.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/type_resolver.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/union.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/types/unset.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/utils/__init__.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/utils/aio.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/utils/await_maybe.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/utils/dataclasses.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/utils/debug.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/utils/deprecations.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/utils/graphql_lexer.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/utils/importer.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/utils/inspect.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/utils/locate_definition.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/utils/logging.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/utils/operation.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/utils/str_converters.py +0 -0
- {strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/utils/typing.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: strawberry-graphql
|
3
|
-
Version: 0.278.
|
3
|
+
Version: 0.278.1
|
4
4
|
Summary: A library for creating GraphQL APIs
|
5
5
|
License: MIT
|
6
6
|
Keywords: graphql,api,rest,starlette,async
|
@@ -37,6 +37,7 @@ Requires-Dist: channels (>=3.0.5) ; extra == "channels"
|
|
37
37
|
Requires-Dist: fastapi (>=0.65.2) ; extra == "fastapi"
|
38
38
|
Requires-Dist: flask (>=1.1) ; extra == "flask"
|
39
39
|
Requires-Dist: graphql-core (>=3.2.0,<3.4.0)
|
40
|
+
Requires-Dist: lia-web (>=0.2.1)
|
40
41
|
Requires-Dist: libcst ; extra == "cli"
|
41
42
|
Requires-Dist: libcst ; extra == "debug"
|
42
43
|
Requires-Dist: libcst ; extra == "debug-server"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[project]
|
2
2
|
name = "strawberry-graphql"
|
3
|
-
version = "0.278.
|
3
|
+
version = "0.278.1"
|
4
4
|
description = "A library for creating GraphQL APIs"
|
5
5
|
authors = [{ name = "Patrick Arminio", email = "patrick.arminio@gmail.com" }]
|
6
6
|
license = { text = "MIT" }
|
@@ -19,6 +19,7 @@ dependencies = [
|
|
19
19
|
"typing-extensions>=4.5.0",
|
20
20
|
"python-dateutil~=2.7",
|
21
21
|
"packaging>=23",
|
22
|
+
"lia-web (>=0.2.1)",
|
22
23
|
]
|
23
24
|
|
24
25
|
[project.urls]
|
@@ -3,32 +3,27 @@ from __future__ import annotations
|
|
3
3
|
import asyncio
|
4
4
|
import warnings
|
5
5
|
from datetime import timedelta
|
6
|
-
from io import BytesIO
|
7
6
|
from json.decoder import JSONDecodeError
|
8
7
|
from typing import (
|
9
8
|
TYPE_CHECKING,
|
10
|
-
Any,
|
11
9
|
Callable,
|
12
10
|
Optional,
|
13
11
|
Union,
|
14
|
-
cast,
|
15
12
|
)
|
16
13
|
from typing_extensions import TypeGuard
|
17
14
|
|
15
|
+
from lia import AiohttpHTTPRequestAdapter, HTTPException
|
16
|
+
|
18
17
|
from aiohttp import ClientConnectionResetError, http, web
|
19
|
-
from aiohttp.multipart import BodyPartReader
|
20
18
|
from strawberry.http.async_base_view import (
|
21
19
|
AsyncBaseHTTPView,
|
22
|
-
AsyncHTTPRequestAdapter,
|
23
20
|
AsyncWebSocketAdapter,
|
24
21
|
)
|
25
22
|
from strawberry.http.exceptions import (
|
26
|
-
HTTPException,
|
27
23
|
NonJsonMessageReceived,
|
28
24
|
NonTextMessageReceived,
|
29
25
|
WebSocketDisconnected,
|
30
26
|
)
|
31
|
-
from strawberry.http.types import FormData, HTTPMethod, QueryParams
|
32
27
|
from strawberry.http.typevars import (
|
33
28
|
Context,
|
34
29
|
RootValue,
|
@@ -43,47 +38,6 @@ if TYPE_CHECKING:
|
|
43
38
|
from strawberry.schema import BaseSchema
|
44
39
|
|
45
40
|
|
46
|
-
class AiohttpHTTPRequestAdapter(AsyncHTTPRequestAdapter):
|
47
|
-
def __init__(self, request: web.Request) -> None:
|
48
|
-
self.request = request
|
49
|
-
|
50
|
-
@property
|
51
|
-
def query_params(self) -> QueryParams:
|
52
|
-
return self.request.query.copy() # type: ignore[attr-defined]
|
53
|
-
|
54
|
-
async def get_body(self) -> str:
|
55
|
-
return (await self.request.content.read()).decode()
|
56
|
-
|
57
|
-
@property
|
58
|
-
def method(self) -> HTTPMethod:
|
59
|
-
return cast("HTTPMethod", self.request.method.upper())
|
60
|
-
|
61
|
-
@property
|
62
|
-
def headers(self) -> Mapping[str, str]:
|
63
|
-
return self.request.headers
|
64
|
-
|
65
|
-
async def get_form_data(self) -> FormData:
|
66
|
-
reader = await self.request.multipart()
|
67
|
-
|
68
|
-
data: dict[str, Any] = {}
|
69
|
-
files: dict[str, Any] = {}
|
70
|
-
|
71
|
-
while field := await reader.next():
|
72
|
-
assert isinstance(field, BodyPartReader)
|
73
|
-
assert field.name
|
74
|
-
|
75
|
-
if field.filename:
|
76
|
-
files[field.name] = BytesIO(await field.read(decode=False))
|
77
|
-
else:
|
78
|
-
data[field.name] = await field.text()
|
79
|
-
|
80
|
-
return FormData(files=files, form=data)
|
81
|
-
|
82
|
-
@property
|
83
|
-
def content_type(self) -> Optional[str]:
|
84
|
-
return self.headers.get("content-type")
|
85
|
-
|
86
|
-
|
87
41
|
class AiohttpWebSocketAdapter(AsyncWebSocketAdapter):
|
88
42
|
def __init__(
|
89
43
|
self, view: AsyncBaseHTTPView, request: web.Request, ws: web.WebSocketResponse
|
@@ -8,10 +8,10 @@ from typing import (
|
|
8
8
|
Callable,
|
9
9
|
Optional,
|
10
10
|
Union,
|
11
|
-
cast,
|
12
11
|
)
|
13
12
|
from typing_extensions import TypeGuard
|
14
13
|
|
14
|
+
from lia import HTTPException, StarletteRequestAdapter
|
15
15
|
from starlette import status
|
16
16
|
from starlette.requests import Request
|
17
17
|
from starlette.responses import (
|
@@ -24,16 +24,13 @@ from starlette.websockets import WebSocket, WebSocketDisconnect, WebSocketState
|
|
24
24
|
|
25
25
|
from strawberry.http.async_base_view import (
|
26
26
|
AsyncBaseHTTPView,
|
27
|
-
AsyncHTTPRequestAdapter,
|
28
27
|
AsyncWebSocketAdapter,
|
29
28
|
)
|
30
29
|
from strawberry.http.exceptions import (
|
31
|
-
HTTPException,
|
32
30
|
NonJsonMessageReceived,
|
33
31
|
NonTextMessageReceived,
|
34
32
|
WebSocketDisconnected,
|
35
33
|
)
|
36
|
-
from strawberry.http.types import FormData, HTTPMethod, QueryParams
|
37
34
|
from strawberry.http.typevars import (
|
38
35
|
Context,
|
39
36
|
RootValue,
|
@@ -50,38 +47,6 @@ if TYPE_CHECKING:
|
|
50
47
|
from strawberry.schema import BaseSchema
|
51
48
|
|
52
49
|
|
53
|
-
class ASGIRequestAdapter(AsyncHTTPRequestAdapter):
|
54
|
-
def __init__(self, request: Request) -> None:
|
55
|
-
self.request = request
|
56
|
-
|
57
|
-
@property
|
58
|
-
def query_params(self) -> QueryParams:
|
59
|
-
return self.request.query_params
|
60
|
-
|
61
|
-
@property
|
62
|
-
def method(self) -> HTTPMethod:
|
63
|
-
return cast("HTTPMethod", self.request.method.upper())
|
64
|
-
|
65
|
-
@property
|
66
|
-
def headers(self) -> Mapping[str, str]:
|
67
|
-
return self.request.headers
|
68
|
-
|
69
|
-
@property
|
70
|
-
def content_type(self) -> Optional[str]:
|
71
|
-
return self.request.headers.get("content-type")
|
72
|
-
|
73
|
-
async def get_body(self) -> bytes:
|
74
|
-
return await self.request.body()
|
75
|
-
|
76
|
-
async def get_form_data(self) -> FormData:
|
77
|
-
multipart_data = await self.request.form()
|
78
|
-
|
79
|
-
return FormData(
|
80
|
-
files=multipart_data,
|
81
|
-
form=multipart_data,
|
82
|
-
)
|
83
|
-
|
84
|
-
|
85
50
|
class ASGIWebSocketAdapter(AsyncWebSocketAdapter):
|
86
51
|
def __init__(
|
87
52
|
self, view: AsyncBaseHTTPView, request: WebSocket, response: WebSocket
|
@@ -127,7 +92,7 @@ class GraphQL(
|
|
127
92
|
]
|
128
93
|
):
|
129
94
|
allow_queries_via_get = True
|
130
|
-
request_adapter_class =
|
95
|
+
request_adapter_class = StarletteRequestAdapter
|
131
96
|
websocket_adapter_class = ASGIWebSocketAdapter
|
132
97
|
|
133
98
|
def __init__(
|
@@ -1,56 +1,21 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
3
|
import warnings
|
4
|
-
from typing import TYPE_CHECKING,
|
4
|
+
from typing import TYPE_CHECKING, Optional, Union
|
5
|
+
|
6
|
+
from lia import ChaliceHTTPRequestAdapter, HTTPException
|
5
7
|
|
6
8
|
from chalice.app import Request, Response
|
7
|
-
from strawberry.http.
|
8
|
-
from strawberry.http.sync_base_view import SyncBaseHTTPView, SyncHTTPRequestAdapter
|
9
|
+
from strawberry.http.sync_base_view import SyncBaseHTTPView
|
9
10
|
from strawberry.http.temporal_response import TemporalResponse
|
10
11
|
from strawberry.http.typevars import Context, RootValue
|
11
12
|
|
12
13
|
if TYPE_CHECKING:
|
13
|
-
from collections.abc import Mapping
|
14
|
-
|
15
14
|
from strawberry.http import GraphQLHTTPResponse
|
16
15
|
from strawberry.http.ides import GraphQL_IDE
|
17
|
-
from strawberry.http.types import HTTPMethod, QueryParams
|
18
16
|
from strawberry.schema import BaseSchema
|
19
17
|
|
20
18
|
|
21
|
-
class ChaliceHTTPRequestAdapter(SyncHTTPRequestAdapter):
|
22
|
-
def __init__(self, request: Request) -> None:
|
23
|
-
self.request = request
|
24
|
-
|
25
|
-
@property
|
26
|
-
def query_params(self) -> QueryParams:
|
27
|
-
return self.request.query_params or {}
|
28
|
-
|
29
|
-
@property
|
30
|
-
def body(self) -> Union[str, bytes]:
|
31
|
-
return self.request.raw_body
|
32
|
-
|
33
|
-
@property
|
34
|
-
def method(self) -> HTTPMethod:
|
35
|
-
return cast("HTTPMethod", self.request.method.upper())
|
36
|
-
|
37
|
-
@property
|
38
|
-
def headers(self) -> Mapping[str, str]:
|
39
|
-
return self.request.headers
|
40
|
-
|
41
|
-
@property
|
42
|
-
def post_data(self) -> Mapping[str, Union[str, bytes]]:
|
43
|
-
raise NotImplementedError
|
44
|
-
|
45
|
-
@property
|
46
|
-
def files(self) -> Mapping[str, Any]:
|
47
|
-
raise NotImplementedError
|
48
|
-
|
49
|
-
@property
|
50
|
-
def content_type(self) -> Optional[str]:
|
51
|
-
return self.request.headers.get("Content-Type", None)
|
52
|
-
|
53
|
-
|
54
19
|
class GraphQLView(
|
55
20
|
SyncBaseHTTPView[Request, Response, TemporalResponse, Context, RootValue]
|
56
21
|
):
|
@@ -12,14 +12,13 @@ from urllib.parse import parse_qs
|
|
12
12
|
from django.conf import settings
|
13
13
|
from django.core.files import uploadhandler
|
14
14
|
from django.http.multipartparser import MultiPartParser
|
15
|
+
from lia import AsyncHTTPRequestAdapter, FormData, HTTPException, SyncHTTPRequestAdapter
|
15
16
|
|
16
17
|
from channels.db import database_sync_to_async
|
17
18
|
from channels.generic.http import AsyncHttpConsumer
|
18
|
-
from strawberry.http.async_base_view import AsyncBaseHTTPView
|
19
|
-
from strawberry.http.
|
20
|
-
from strawberry.http.sync_base_view import SyncBaseHTTPView, SyncHTTPRequestAdapter
|
19
|
+
from strawberry.http.async_base_view import AsyncBaseHTTPView
|
20
|
+
from strawberry.http.sync_base_view import SyncBaseHTTPView
|
21
21
|
from strawberry.http.temporal_response import TemporalResponse
|
22
|
-
from strawberry.http.types import FormData
|
23
22
|
from strawberry.http.typevars import Context, RootValue
|
24
23
|
from strawberry.types.unset import UNSET
|
25
24
|
|
@@ -127,6 +126,28 @@ class BaseChannelsRequestAdapter:
|
|
127
126
|
def content_type(self) -> Optional[str]:
|
128
127
|
return self.request.content_type
|
129
128
|
|
129
|
+
@property
|
130
|
+
def url(self) -> str:
|
131
|
+
scheme = self.request.consumer.scope["scheme"]
|
132
|
+
host = self.headers.get("host", "localhost")
|
133
|
+
path = self.request.consumer.scope["path"]
|
134
|
+
query_string = self.request.consumer.scope["query_string"]
|
135
|
+
url = f"{scheme}://{host}{path}"
|
136
|
+
if query_string:
|
137
|
+
url += f"?{query_string.decode()}"
|
138
|
+
return url
|
139
|
+
|
140
|
+
@property
|
141
|
+
def cookies(self) -> Mapping[str, str]:
|
142
|
+
cookie_header = self.headers.get("cookie", "")
|
143
|
+
cookies = {}
|
144
|
+
if cookie_header:
|
145
|
+
for cookie in cookie_header.split(";"):
|
146
|
+
if "=" in cookie:
|
147
|
+
key, value = cookie.split("=", 1)
|
148
|
+
cookies[key.strip()] = value.strip()
|
149
|
+
return cookies
|
150
|
+
|
130
151
|
|
131
152
|
class ChannelsRequestAdapter(BaseChannelsRequestAdapter, AsyncHTTPRequestAdapter):
|
132
153
|
async def get_body(self) -> bytes:
|
@@ -143,11 +164,14 @@ class SyncChannelsRequestAdapter(BaseChannelsRequestAdapter, SyncHTTPRequestAdap
|
|
143
164
|
|
144
165
|
@property
|
145
166
|
def post_data(self) -> Mapping[str, Union[str, bytes]]:
|
146
|
-
return self.request.form_data
|
167
|
+
return self.request.form_data.form
|
147
168
|
|
148
169
|
@property
|
149
170
|
def files(self) -> Mapping[str, Any]:
|
150
|
-
return self.request.form_data
|
171
|
+
return self.request.form_data.files
|
172
|
+
|
173
|
+
def get_form_data(self) -> FormData:
|
174
|
+
return self.request.form_data
|
151
175
|
|
152
176
|
|
153
177
|
class BaseGraphQLHTTPConsumer(ChannelsConsumer, AsyncHttpConsumer):
|
@@ -8,7 +8,6 @@ from typing import (
|
|
8
8
|
Callable,
|
9
9
|
Optional,
|
10
10
|
Union,
|
11
|
-
cast,
|
12
11
|
)
|
13
12
|
from typing_extensions import TypeGuard
|
14
13
|
|
@@ -26,11 +25,10 @@ from django.template.exceptions import TemplateDoesNotExist
|
|
26
25
|
from django.template.loader import render_to_string
|
27
26
|
from django.utils.decorators import classonlymethod
|
28
27
|
from django.views.generic import View
|
28
|
+
from lia import AsyncDjangoHTTPRequestAdapter, DjangoHTTPRequestAdapter, HTTPException
|
29
29
|
|
30
|
-
from strawberry.http.async_base_view import AsyncBaseHTTPView
|
31
|
-
from strawberry.http.
|
32
|
-
from strawberry.http.sync_base_view import SyncBaseHTTPView, SyncHTTPRequestAdapter
|
33
|
-
from strawberry.http.types import FormData, HTTPMethod, QueryParams
|
30
|
+
from strawberry.http.async_base_view import AsyncBaseHTTPView
|
31
|
+
from strawberry.http.sync_base_view import SyncBaseHTTPView
|
34
32
|
from strawberry.http.typevars import (
|
35
33
|
Context,
|
36
34
|
RootValue,
|
@@ -39,7 +37,7 @@ from strawberry.http.typevars import (
|
|
39
37
|
from .context import StrawberryDjangoContext
|
40
38
|
|
41
39
|
if TYPE_CHECKING:
|
42
|
-
from collections.abc import AsyncIterator
|
40
|
+
from collections.abc import AsyncIterator
|
43
41
|
|
44
42
|
from django.template.response import TemplateResponse
|
45
43
|
|
@@ -67,73 +65,6 @@ class TemporalHttpResponse(JsonResponse):
|
|
67
65
|
)
|
68
66
|
|
69
67
|
|
70
|
-
class DjangoHTTPRequestAdapter(SyncHTTPRequestAdapter):
|
71
|
-
def __init__(self, request: HttpRequest) -> None:
|
72
|
-
self.request = request
|
73
|
-
|
74
|
-
@property
|
75
|
-
def query_params(self) -> QueryParams:
|
76
|
-
return self.request.GET.dict()
|
77
|
-
|
78
|
-
@property
|
79
|
-
def body(self) -> Union[str, bytes]:
|
80
|
-
return self.request.body.decode()
|
81
|
-
|
82
|
-
@property
|
83
|
-
def method(self) -> HTTPMethod:
|
84
|
-
assert self.request.method is not None
|
85
|
-
|
86
|
-
return cast("HTTPMethod", self.request.method.upper())
|
87
|
-
|
88
|
-
@property
|
89
|
-
def headers(self) -> Mapping[str, str]:
|
90
|
-
return self.request.headers
|
91
|
-
|
92
|
-
@property
|
93
|
-
def post_data(self) -> Mapping[str, Union[str, bytes]]:
|
94
|
-
return self.request.POST
|
95
|
-
|
96
|
-
@property
|
97
|
-
def files(self) -> Mapping[str, Any]:
|
98
|
-
return self.request.FILES
|
99
|
-
|
100
|
-
@property
|
101
|
-
def content_type(self) -> Optional[str]:
|
102
|
-
return self.request.content_type
|
103
|
-
|
104
|
-
|
105
|
-
class AsyncDjangoHTTPRequestAdapter(AsyncHTTPRequestAdapter):
|
106
|
-
def __init__(self, request: HttpRequest) -> None:
|
107
|
-
self.request = request
|
108
|
-
|
109
|
-
@property
|
110
|
-
def query_params(self) -> QueryParams:
|
111
|
-
return self.request.GET.dict()
|
112
|
-
|
113
|
-
@property
|
114
|
-
def method(self) -> HTTPMethod:
|
115
|
-
assert self.request.method is not None
|
116
|
-
|
117
|
-
return cast("HTTPMethod", self.request.method.upper())
|
118
|
-
|
119
|
-
@property
|
120
|
-
def headers(self) -> Mapping[str, str]:
|
121
|
-
return self.request.headers
|
122
|
-
|
123
|
-
@property
|
124
|
-
def content_type(self) -> Optional[str]:
|
125
|
-
return self.headers.get("Content-type")
|
126
|
-
|
127
|
-
async def get_body(self) -> str:
|
128
|
-
return self.request.body.decode()
|
129
|
-
|
130
|
-
async def get_form_data(self) -> FormData:
|
131
|
-
return FormData(
|
132
|
-
files=self.request.FILES,
|
133
|
-
form=self.request.POST,
|
134
|
-
)
|
135
|
-
|
136
|
-
|
137
68
|
class BaseView:
|
138
69
|
graphql_ide_html: str
|
139
70
|
|
@@ -13,6 +13,7 @@ from typing import (
|
|
13
13
|
)
|
14
14
|
from typing_extensions import TypeGuard
|
15
15
|
|
16
|
+
from lia import HTTPException, StarletteRequestAdapter
|
16
17
|
from starlette import status
|
17
18
|
from starlette.background import BackgroundTasks # noqa: TC002
|
18
19
|
from starlette.requests import HTTPConnection, Request
|
@@ -29,16 +30,19 @@ from fastapi import APIRouter, Depends, params
|
|
29
30
|
from fastapi.datastructures import Default
|
30
31
|
from fastapi.routing import APIRoute
|
31
32
|
from fastapi.utils import generate_unique_id
|
32
|
-
from strawberry.asgi import
|
33
|
+
from strawberry.asgi import ASGIWebSocketAdapter
|
33
34
|
from strawberry.exceptions import InvalidCustomContext
|
34
35
|
from strawberry.fastapi.context import BaseContext, CustomContext
|
35
36
|
from strawberry.http.async_base_view import AsyncBaseHTTPView
|
36
|
-
from strawberry.http.exceptions import HTTPException
|
37
37
|
from strawberry.http.typevars import Context, RootValue
|
38
38
|
from strawberry.subscriptions import GRAPHQL_TRANSPORT_WS_PROTOCOL, GRAPHQL_WS_PROTOCOL
|
39
39
|
|
40
40
|
if TYPE_CHECKING:
|
41
|
-
from collections.abc import
|
41
|
+
from collections.abc import (
|
42
|
+
AsyncIterator,
|
43
|
+
Awaitable,
|
44
|
+
Sequence,
|
45
|
+
)
|
42
46
|
from enum import Enum
|
43
47
|
|
44
48
|
from starlette.routing import BaseRoute
|
@@ -57,7 +61,7 @@ class GraphQLRouter(
|
|
57
61
|
APIRouter,
|
58
62
|
):
|
59
63
|
allow_queries_via_get = True
|
60
|
-
request_adapter_class =
|
64
|
+
request_adapter_class = StarletteRequestAdapter
|
61
65
|
websocket_adapter_class = ASGIWebSocketAdapter
|
62
66
|
|
63
67
|
@staticmethod
|
@@ -3,67 +3,27 @@ from __future__ import annotations
|
|
3
3
|
import warnings
|
4
4
|
from typing import (
|
5
5
|
TYPE_CHECKING,
|
6
|
-
Any,
|
7
6
|
ClassVar,
|
8
7
|
Optional,
|
9
8
|
Union,
|
10
|
-
cast,
|
11
9
|
)
|
12
10
|
from typing_extensions import TypeGuard
|
13
11
|
|
12
|
+
from lia import AsyncFlaskHTTPRequestAdapter, FlaskHTTPRequestAdapter, HTTPException
|
13
|
+
|
14
14
|
from flask import Request, Response, render_template_string, request
|
15
15
|
from flask.views import View
|
16
|
-
from strawberry.http.async_base_view import AsyncBaseHTTPView
|
17
|
-
from strawberry.http.
|
18
|
-
from strawberry.http.sync_base_view import (
|
19
|
-
SyncBaseHTTPView,
|
20
|
-
SyncHTTPRequestAdapter,
|
21
|
-
)
|
22
|
-
from strawberry.http.types import FormData, HTTPMethod, QueryParams
|
16
|
+
from strawberry.http.async_base_view import AsyncBaseHTTPView
|
17
|
+
from strawberry.http.sync_base_view import SyncBaseHTTPView
|
23
18
|
from strawberry.http.typevars import Context, RootValue
|
24
19
|
|
25
20
|
if TYPE_CHECKING:
|
26
|
-
from collections.abc import Mapping
|
27
|
-
|
28
21
|
from flask.typing import ResponseReturnValue
|
29
22
|
from strawberry.http import GraphQLHTTPResponse
|
30
23
|
from strawberry.http.ides import GraphQL_IDE
|
31
24
|
from strawberry.schema.base import BaseSchema
|
32
25
|
|
33
26
|
|
34
|
-
class FlaskHTTPRequestAdapter(SyncHTTPRequestAdapter):
|
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 body(self) -> Union[str, bytes]:
|
44
|
-
return self.request.data.decode()
|
45
|
-
|
46
|
-
@property
|
47
|
-
def method(self) -> HTTPMethod:
|
48
|
-
return cast("HTTPMethod", self.request.method.upper())
|
49
|
-
|
50
|
-
@property
|
51
|
-
def headers(self) -> Mapping[str, str]:
|
52
|
-
return self.request.headers # type: ignore
|
53
|
-
|
54
|
-
@property
|
55
|
-
def post_data(self) -> Mapping[str, Union[str, bytes]]:
|
56
|
-
return self.request.form
|
57
|
-
|
58
|
-
@property
|
59
|
-
def files(self) -> Mapping[str, Any]:
|
60
|
-
return self.request.files
|
61
|
-
|
62
|
-
@property
|
63
|
-
def content_type(self) -> Optional[str]:
|
64
|
-
return self.request.content_type
|
65
|
-
|
66
|
-
|
67
27
|
class BaseGraphQLView:
|
68
28
|
graphql_ide: Optional[GraphQL_IDE]
|
69
29
|
|
@@ -131,36 +91,6 @@ class GraphQLView(
|
|
131
91
|
return render_template_string(self.graphql_ide_html) # type: ignore
|
132
92
|
|
133
93
|
|
134
|
-
class AsyncFlaskHTTPRequestAdapter(AsyncHTTPRequestAdapter):
|
135
|
-
def __init__(self, request: Request) -> None:
|
136
|
-
self.request = request
|
137
|
-
|
138
|
-
@property
|
139
|
-
def query_params(self) -> QueryParams:
|
140
|
-
return self.request.args.to_dict()
|
141
|
-
|
142
|
-
@property
|
143
|
-
def method(self) -> HTTPMethod:
|
144
|
-
return cast("HTTPMethod", self.request.method.upper())
|
145
|
-
|
146
|
-
@property
|
147
|
-
def content_type(self) -> Optional[str]:
|
148
|
-
return self.request.content_type
|
149
|
-
|
150
|
-
@property
|
151
|
-
def headers(self) -> Mapping[str, str]:
|
152
|
-
return self.request.headers # type: ignore
|
153
|
-
|
154
|
-
async def get_body(self) -> str:
|
155
|
-
return self.request.data.decode()
|
156
|
-
|
157
|
-
async def get_form_data(self) -> FormData:
|
158
|
-
return FormData(
|
159
|
-
files=self.request.files,
|
160
|
-
form=self.request.form,
|
161
|
-
)
|
162
|
-
|
163
|
-
|
164
94
|
class AsyncGraphQLView(
|
165
95
|
BaseGraphQLView,
|
166
96
|
AsyncBaseHTTPView[
|
{strawberry_graphql-0.278.0 → strawberry_graphql-0.278.1}/strawberry/http/async_base_view.py
RENAMED
@@ -17,6 +17,7 @@ from typing import (
|
|
17
17
|
from typing_extensions import TypeGuard
|
18
18
|
|
19
19
|
from graphql import GraphQLError
|
20
|
+
from lia import AsyncHTTPRequestAdapter, HTTPException
|
20
21
|
|
21
22
|
from strawberry.exceptions import MissingQueryError
|
22
23
|
from strawberry.file_uploads.utils import replace_placeholders_with_files
|
@@ -44,9 +45,7 @@ from strawberry.types.graphql import OperationType
|
|
44
45
|
from strawberry.types.unset import UNSET, UnsetType
|
45
46
|
|
46
47
|
from .base import BaseView
|
47
|
-
from .exceptions import HTTPException
|
48
48
|
from .parse_content_type import parse_content_type
|
49
|
-
from .types import FormData, HTTPMethod, QueryParams
|
50
49
|
from .typevars import (
|
51
50
|
Context,
|
52
51
|
Request,
|
@@ -58,30 +57,6 @@ from .typevars import (
|
|
58
57
|
)
|
59
58
|
|
60
59
|
|
61
|
-
class AsyncHTTPRequestAdapter(abc.ABC):
|
62
|
-
@property
|
63
|
-
@abc.abstractmethod
|
64
|
-
def query_params(self) -> QueryParams: ...
|
65
|
-
|
66
|
-
@property
|
67
|
-
@abc.abstractmethod
|
68
|
-
def method(self) -> HTTPMethod: ...
|
69
|
-
|
70
|
-
@property
|
71
|
-
@abc.abstractmethod
|
72
|
-
def headers(self) -> Mapping[str, str]: ...
|
73
|
-
|
74
|
-
@property
|
75
|
-
@abc.abstractmethod
|
76
|
-
def content_type(self) -> Optional[str]: ...
|
77
|
-
|
78
|
-
@abc.abstractmethod
|
79
|
-
async def get_body(self) -> Union[str, bytes]: ...
|
80
|
-
|
81
|
-
@abc.abstractmethod
|
82
|
-
async def get_form_data(self) -> FormData: ...
|
83
|
-
|
84
|
-
|
85
60
|
class AsyncWebSocketAdapter(abc.ABC):
|
86
61
|
def __init__(self, view: "AsyncBaseHTTPView") -> None:
|
87
62
|
self.view = view
|
@@ -284,8 +259,9 @@ class AsyncBaseHTTPView(
|
|
284
259
|
except ValueError as e:
|
285
260
|
raise HTTPException(400, "Unable to parse the multipart body") from e
|
286
261
|
|
287
|
-
operations = form_data
|
288
|
-
files_map = form_data
|
262
|
+
operations = form_data.form.get("operations", "{}")
|
263
|
+
files_map = form_data.form.get("map", "{}")
|
264
|
+
files = form_data.files
|
289
265
|
|
290
266
|
if isinstance(operations, (bytes, str)):
|
291
267
|
operations = self.parse_json(operations)
|
@@ -294,9 +270,7 @@ class AsyncBaseHTTPView(
|
|
294
270
|
files_map = self.parse_json(files_map)
|
295
271
|
|
296
272
|
try:
|
297
|
-
return replace_placeholders_with_files(
|
298
|
-
operations, files_map, form_data["files"]
|
299
|
-
)
|
273
|
+
return replace_placeholders_with_files(operations, files_map, files)
|
300
274
|
except KeyError as e:
|
301
275
|
raise HTTPException(400, "File(s) missing in form data") from e
|
302
276
|
|
@@ -3,12 +3,13 @@ from collections.abc import Mapping
|
|
3
3
|
from typing import Any, Generic, Optional, Union
|
4
4
|
from typing_extensions import Protocol
|
5
5
|
|
6
|
+
from lia import HTTPException
|
7
|
+
|
6
8
|
from strawberry.http import GraphQLRequestData
|
7
9
|
from strawberry.http.ides import GraphQL_IDE, get_graphql_ide_html
|
8
10
|
from strawberry.http.types import HTTPMethod, QueryParams
|
9
11
|
from strawberry.schema.base import BaseSchema
|
10
12
|
|
11
|
-
from .exceptions import HTTPException
|
12
13
|
from .typevars import Request
|
13
14
|
|
14
15
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class NonTextMessageReceived(Exception):
|
2
|
+
pass
|
3
|
+
|
4
|
+
|
5
|
+
class NonJsonMessageReceived(Exception):
|
6
|
+
pass
|
7
|
+
|
8
|
+
|
9
|
+
class WebSocketDisconnected(Exception):
|
10
|
+
pass
|
11
|
+
|
12
|
+
|
13
|
+
__all__ = [
|
14
|
+
"NonJsonMessageReceived",
|
15
|
+
"NonTextMessageReceived",
|
16
|
+
"WebSocketDisconnected",
|
17
|
+
]
|