strawberry-graphql 0.279.0.dev1754159379__tar.gz → 0.280.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.
Potentially problematic release.
This version of strawberry-graphql might be problematic. Click here for more details.
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/PKG-INFO +2 -1
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/pyproject.toml +2 -1
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/__init__.py +1 -2
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/aiohttp/views.py +2 -48
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/asgi/__init__.py +2 -37
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/chalice/views.py +7 -75
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/channels/handlers/http_handler.py +30 -6
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/cli/commands/upgrade/__init__.py +2 -0
- strawberry_graphql-0.280.0/strawberry/codemods/__init__.py +9 -0
- strawberry_graphql-0.280.0/strawberry/codemods/maybe_optional.py +118 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/django/views.py +4 -73
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/experimental/pydantic/_compat.py +1 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/experimental/pydantic/error_type.py +1 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/experimental/pydantic/fields.py +1 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/experimental/pydantic/utils.py +1 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/fastapi/router.py +8 -4
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/flask/views.py +4 -74
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/http/async_base_view.py +5 -31
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/http/base.py +2 -1
- strawberry_graphql-0.280.0/strawberry/http/exceptions.py +17 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/http/sync_base_view.py +1 -34
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/litestar/controller.py +1 -39
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/quart/views.py +3 -33
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/sanic/views.py +4 -43
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/schema/schema.py +2 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/schema/schema_converter.py +15 -38
- strawberry_graphql-0.280.0/strawberry/schema/validation_rules/maybe_null.py +136 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/types/arguments.py +16 -2
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/types/maybe.py +1 -1
- strawberry_graphql-0.279.0.dev1754159379/strawberry/http/exceptions.py +0 -19
- strawberry_graphql-0.279.0.dev1754159379/strawberry/pydantic/__init__.py +0 -22
- strawberry_graphql-0.279.0.dev1754159379/strawberry/pydantic/error.py +0 -51
- strawberry_graphql-0.279.0.dev1754159379/strawberry/pydantic/fields.py +0 -202
- strawberry_graphql-0.279.0.dev1754159379/strawberry/pydantic/object_type.py +0 -348
- strawberry_graphql-0.279.0.dev1754159379/strawberry/types/fields/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/LICENSE +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/README.md +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/__main__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/aiohttp/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/aiohttp/test/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/aiohttp/test/client.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/annotation.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/asgi/test/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/asgi/test/client.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/chalice/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/channels/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/channels/handlers/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/channels/handlers/base.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/channels/handlers/ws_handler.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/channels/router.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/channels/testing.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/cli/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/cli/app.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/cli/commands/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/cli/commands/codegen.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/cli/commands/export_schema.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/cli/commands/locate_definition.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/cli/commands/schema_codegen.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/cli/commands/server.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/cli/commands/upgrade/_fake_progress.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/cli/commands/upgrade/_run_codemod.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/cli/constants.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/cli/debug_server.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/cli/utils/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/cli/utils/load_schema.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/codegen/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/codegen/exceptions.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/codegen/plugins/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/codegen/plugins/print_operation.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/codegen/plugins/python.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/codegen/plugins/typescript.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/codegen/query_codegen.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/codegen/types.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/codemods/annotated_unions.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/codemods/update_imports.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/dataloader.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/directive.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/django/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/django/apps.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/django/context.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/django/test/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/django/test/client.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/exceptions/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/exceptions/conflicting_arguments.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/exceptions/duplicated_type_name.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/exceptions/exception.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/exceptions/exception_source.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/exceptions/handler.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/exceptions/invalid_argument_type.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/exceptions/invalid_superclass_interface.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/exceptions/invalid_union_type.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/exceptions/missing_arguments_annotations.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/exceptions/missing_dependencies.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/exceptions/missing_field_annotation.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/exceptions/missing_return_annotation.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/exceptions/object_is_not_a_class.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/exceptions/object_is_not_an_enum.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/exceptions/permission_fail_silently_requires_optional.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/exceptions/private_strawberry_field.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/exceptions/scalar_already_registered.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/exceptions/syntax.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/exceptions/unresolved_field_type.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379/strawberry/codemods → strawberry_graphql-0.280.0/strawberry/exceptions/utils}/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/exceptions/utils/source_finder.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/experimental/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/experimental/pydantic/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/experimental/pydantic/conversion.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/experimental/pydantic/conversion_types.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/experimental/pydantic/exceptions.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/experimental/pydantic/object_type.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/ext/LICENSE +0 -0
- {strawberry_graphql-0.279.0.dev1754159379/strawberry/exceptions/utils → strawberry_graphql-0.280.0/strawberry/ext}/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/ext/dataclasses/LICENSE +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/ext/dataclasses/README.md +0 -0
- {strawberry_graphql-0.279.0.dev1754159379/strawberry/ext → strawberry_graphql-0.280.0/strawberry/ext/dataclasses}/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/ext/dataclasses/dataclasses.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/ext/mypy_plugin.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/extensions/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/extensions/add_validation_rules.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/extensions/base_extension.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/extensions/context.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/extensions/directives.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/extensions/disable_introspection.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/extensions/disable_validation.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/extensions/field_extension.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/extensions/mask_errors.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/extensions/max_aliases.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/extensions/max_tokens.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/extensions/parser_cache.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/extensions/pyinstrument.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/extensions/query_depth_limiter.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/extensions/runner.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/extensions/tracing/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/extensions/tracing/apollo.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/extensions/tracing/datadog.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/extensions/tracing/opentelemetry.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/extensions/tracing/utils.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/extensions/utils.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/extensions/validation_cache.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/fastapi/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/fastapi/context.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/federation/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/federation/argument.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/federation/enum.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/federation/field.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/federation/mutation.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/federation/object_type.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/federation/scalar.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/federation/schema.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/federation/schema_directive.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/federation/schema_directives.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/federation/types.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/federation/union.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/field_extensions/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/field_extensions/input_mutation.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/file_uploads/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/file_uploads/scalars.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/file_uploads/utils.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379/strawberry/ext/dataclasses → strawberry_graphql-0.280.0/strawberry/flask}/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/http/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/http/ides.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/http/parse_content_type.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/http/temporal_response.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/http/types.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/http/typevars.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/litestar/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/parent.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/permission.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/printer/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/printer/ast_from_value.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/printer/printer.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/py.typed +0 -0
- {strawberry_graphql-0.279.0.dev1754159379/strawberry/flask → strawberry_graphql-0.280.0/strawberry/quart}/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/relay/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/relay/exceptions.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/relay/fields.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/relay/types.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/relay/utils.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/resolvers.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379/strawberry/quart → strawberry_graphql-0.280.0/strawberry/sanic}/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/sanic/context.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/sanic/utils.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/scalars.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/schema/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/schema/_graphql_core.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/schema/base.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/schema/compat.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/schema/config.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/schema/exceptions.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/schema/name_converter.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/schema/types/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/schema/types/base_scalars.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/schema/types/concrete_type.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/schema/types/scalar.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379/strawberry/sanic → strawberry_graphql-0.280.0/strawberry/schema/validation_rules}/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/schema/validation_rules/one_of.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/schema_codegen/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/schema_directive.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/schema_directives.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/static/apollo-sandbox.html +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/static/graphiql.html +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/static/pathfinder.html +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/streamable.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/subscriptions/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379/strawberry/schema/validation_rules → strawberry_graphql-0.280.0/strawberry/subscriptions/protocols}/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/subscriptions/protocols/graphql_transport_ws/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/subscriptions/protocols/graphql_transport_ws/handlers.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/subscriptions/protocols/graphql_transport_ws/types.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379/strawberry/subscriptions/protocols → strawberry_graphql-0.280.0/strawberry/subscriptions/protocols/graphql_ws}/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/subscriptions/protocols/graphql_ws/handlers.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/subscriptions/protocols/graphql_ws/types.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/test/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/test/client.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/tools/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/tools/create_type.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/tools/merge_types.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/types/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/types/auto.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/types/base.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/types/cast.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/types/enum.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/types/execution.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/types/field.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379/strawberry/subscriptions/protocols/graphql_ws → strawberry_graphql-0.280.0/strawberry/types/fields}/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/types/fields/resolver.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/types/graphql.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/types/info.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/types/lazy_type.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/types/mutation.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/types/nodes.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/types/object_type.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/types/private.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/types/scalar.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/types/type_resolver.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/types/union.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/types/unset.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/utils/__init__.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/utils/aio.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/utils/await_maybe.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/utils/dataclasses.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/utils/debug.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/utils/deprecations.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/utils/graphql_lexer.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/utils/importer.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/utils/inspect.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/utils/locate_definition.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/utils/logging.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/utils/operation.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/utils/str_converters.py +0 -0
- {strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/utils/typing.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: strawberry-graphql
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.280.0
|
|
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.
|
|
3
|
+
version = "0.280.0"
|
|
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]
|
{strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/__init__.py
RENAMED
|
@@ -4,7 +4,7 @@ Strawberry is a Python library for GraphQL that aims to stay close to the GraphQ
|
|
|
4
4
|
specification and allow for a more natural way of defining GraphQL schemas.
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
|
-
from . import experimental, federation,
|
|
7
|
+
from . import experimental, federation, relay
|
|
8
8
|
from .directive import directive, directive_field
|
|
9
9
|
from .parent import Parent
|
|
10
10
|
from .permission import BasePermission
|
|
@@ -54,7 +54,6 @@ __all__ = [
|
|
|
54
54
|
"interface",
|
|
55
55
|
"lazy",
|
|
56
56
|
"mutation",
|
|
57
|
-
"pydantic",
|
|
58
57
|
"relay",
|
|
59
58
|
"scalar",
|
|
60
59
|
"schema_directive",
|
{strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/aiohttp/views.py
RENAMED
|
@@ -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
|
{strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/asgi/__init__.py
RENAMED
|
@@ -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__(
|
{strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/chalice/views.py
RENAMED
|
@@ -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
|
):
|
|
@@ -88,28 +53,6 @@ class GraphQLView(
|
|
|
88
53
|
def get_sub_response(self, request: Request) -> TemporalResponse:
|
|
89
54
|
return TemporalResponse()
|
|
90
55
|
|
|
91
|
-
@staticmethod
|
|
92
|
-
def error_response(
|
|
93
|
-
message: str,
|
|
94
|
-
error_code: str,
|
|
95
|
-
http_status_code: int,
|
|
96
|
-
headers: Optional[dict[str, str | list[str]]] = None,
|
|
97
|
-
) -> Response:
|
|
98
|
-
"""A wrapper for error responses.
|
|
99
|
-
|
|
100
|
-
Args:
|
|
101
|
-
message: The error message.
|
|
102
|
-
error_code: The error code.
|
|
103
|
-
http_status_code: The HTTP status code.
|
|
104
|
-
headers: The headers to include in the response.
|
|
105
|
-
|
|
106
|
-
Returns:
|
|
107
|
-
An errors response.
|
|
108
|
-
"""
|
|
109
|
-
body = {"Code": error_code, "Message": message}
|
|
110
|
-
|
|
111
|
-
return Response(body=body, status_code=http_status_code, headers=headers)
|
|
112
|
-
|
|
113
56
|
def get_context(self, request: Request, response: TemporalResponse) -> Context:
|
|
114
57
|
return {"request": request, "response": response} # type: ignore
|
|
115
58
|
|
|
@@ -136,20 +79,9 @@ class GraphQLView(
|
|
|
136
79
|
try:
|
|
137
80
|
return self.run(request=request)
|
|
138
81
|
except HTTPException as e:
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
403: "ForbiddenError",
|
|
143
|
-
404: "NotFoundError",
|
|
144
|
-
409: "ConflictError",
|
|
145
|
-
429: "TooManyRequestsError",
|
|
146
|
-
500: "ChaliceViewError",
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
return self.error_response(
|
|
150
|
-
error_code=error_code_map.get(e.status_code, "ChaliceViewError"),
|
|
151
|
-
message=e.reason,
|
|
152
|
-
http_status_code=e.status_code,
|
|
82
|
+
return Response(
|
|
83
|
+
body=e.reason,
|
|
84
|
+
status_code=e.status_code,
|
|
153
85
|
)
|
|
154
86
|
|
|
155
87
|
|
|
@@ -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):
|
|
@@ -10,6 +10,7 @@ from libcst.codemod import CodemodContext
|
|
|
10
10
|
|
|
11
11
|
from strawberry.cli.app import app
|
|
12
12
|
from strawberry.codemods.annotated_unions import ConvertUnionToAnnotatedUnion
|
|
13
|
+
from strawberry.codemods.maybe_optional import ConvertMaybeToOptional
|
|
13
14
|
from strawberry.codemods.update_imports import UpdateImportsCodemod
|
|
14
15
|
|
|
15
16
|
from ._run_codemod import run_codemod
|
|
@@ -17,6 +18,7 @@ from ._run_codemod import run_codemod
|
|
|
17
18
|
codemods = {
|
|
18
19
|
"annotated-union": ConvertUnionToAnnotatedUnion,
|
|
19
20
|
"update-imports": UpdateImportsCodemod,
|
|
21
|
+
"maybe-optional": ConvertMaybeToOptional,
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
from .annotated_unions import ConvertUnionToAnnotatedUnion
|
|
2
|
+
from .maybe_optional import ConvertMaybeToOptional
|
|
3
|
+
from .update_imports import UpdateImportsCodemod
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"ConvertMaybeToOptional",
|
|
7
|
+
"ConvertUnionToAnnotatedUnion",
|
|
8
|
+
"UpdateImportsCodemod",
|
|
9
|
+
]
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import libcst as cst
|
|
4
|
+
import libcst.matchers as m
|
|
5
|
+
from libcst._nodes.expression import BaseExpression # noqa: TC002
|
|
6
|
+
from libcst.codemod import CodemodContext, VisitorBasedCodemodCommand
|
|
7
|
+
from libcst.codemod.visitors import AddImportsVisitor
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ConvertMaybeToOptional(VisitorBasedCodemodCommand):
|
|
11
|
+
DESCRIPTION: str = (
|
|
12
|
+
"Converts strawberry.Maybe[T] to strawberry.Maybe[T | None] "
|
|
13
|
+
"to match the new Maybe type definition"
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
def __init__(
|
|
17
|
+
self,
|
|
18
|
+
context: CodemodContext,
|
|
19
|
+
use_pipe_syntax: bool = True, # Default to pipe syntax for modern Python
|
|
20
|
+
) -> None:
|
|
21
|
+
self.use_pipe_syntax = use_pipe_syntax
|
|
22
|
+
super().__init__(context)
|
|
23
|
+
|
|
24
|
+
@m.leave(
|
|
25
|
+
m.Subscript(
|
|
26
|
+
value=m.Attribute(value=m.Name("strawberry"), attr=m.Name("Maybe"))
|
|
27
|
+
| m.Name("Maybe")
|
|
28
|
+
)
|
|
29
|
+
)
|
|
30
|
+
def leave_maybe_subscript(
|
|
31
|
+
self, original_node: cst.Subscript, updated_node: cst.Subscript
|
|
32
|
+
) -> BaseExpression:
|
|
33
|
+
# Skip if it's not a strawberry.Maybe or imported Maybe
|
|
34
|
+
if isinstance(original_node.value, cst.Name):
|
|
35
|
+
# Check if this is an imported Maybe from strawberry
|
|
36
|
+
# For now, we'll assume any standalone "Maybe" is from strawberry
|
|
37
|
+
# In a more robust implementation, we'd track imports
|
|
38
|
+
pass
|
|
39
|
+
|
|
40
|
+
# Get the inner type
|
|
41
|
+
if isinstance(original_node.slice, (list, tuple)):
|
|
42
|
+
if len(original_node.slice) != 1:
|
|
43
|
+
return original_node
|
|
44
|
+
slice_element = original_node.slice[0]
|
|
45
|
+
else:
|
|
46
|
+
slice_element = original_node.slice
|
|
47
|
+
|
|
48
|
+
if not isinstance(slice_element, cst.SubscriptElement):
|
|
49
|
+
return original_node
|
|
50
|
+
|
|
51
|
+
if not isinstance(slice_element.slice, cst.Index):
|
|
52
|
+
return original_node
|
|
53
|
+
|
|
54
|
+
inner_type = slice_element.slice.value
|
|
55
|
+
|
|
56
|
+
# Check if the inner type already includes None
|
|
57
|
+
if self._already_includes_none(inner_type):
|
|
58
|
+
return original_node
|
|
59
|
+
|
|
60
|
+
# Create the new union type with None
|
|
61
|
+
new_type: BaseExpression
|
|
62
|
+
if self.use_pipe_syntax:
|
|
63
|
+
new_type = cst.BinaryOperation(
|
|
64
|
+
left=inner_type,
|
|
65
|
+
operator=cst.BitOr(
|
|
66
|
+
whitespace_before=cst.SimpleWhitespace(" "),
|
|
67
|
+
whitespace_after=cst.SimpleWhitespace(" "),
|
|
68
|
+
),
|
|
69
|
+
right=cst.Name("None"),
|
|
70
|
+
)
|
|
71
|
+
else:
|
|
72
|
+
# Use Union[T, None] syntax
|
|
73
|
+
AddImportsVisitor.add_needed_import(self.context, "typing", "Union")
|
|
74
|
+
new_type = cst.Subscript(
|
|
75
|
+
value=cst.Name("Union"),
|
|
76
|
+
slice=[
|
|
77
|
+
cst.SubscriptElement(slice=cst.Index(value=inner_type)),
|
|
78
|
+
cst.SubscriptElement(slice=cst.Index(value=cst.Name("None"))),
|
|
79
|
+
],
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
# Return the updated Maybe[T | None]
|
|
83
|
+
return updated_node.with_changes(
|
|
84
|
+
slice=[cst.SubscriptElement(slice=cst.Index(value=new_type))]
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
def _already_includes_none(self, node: BaseExpression) -> bool:
|
|
88
|
+
"""Check if the type already includes None (e.g., T | None or Union[T, None])."""
|
|
89
|
+
# Check for T | None pattern
|
|
90
|
+
if isinstance(node, cst.BinaryOperation) and isinstance(
|
|
91
|
+
node.operator, cst.BitOr
|
|
92
|
+
):
|
|
93
|
+
if isinstance(node.right, cst.Name) and node.right.value == "None":
|
|
94
|
+
return True
|
|
95
|
+
# Recursively check left side for chained unions
|
|
96
|
+
if self._already_includes_none(node.left):
|
|
97
|
+
return True
|
|
98
|
+
|
|
99
|
+
# Check for Union[..., None] pattern
|
|
100
|
+
if (
|
|
101
|
+
isinstance(node, cst.Subscript)
|
|
102
|
+
and isinstance(node.value, cst.Name)
|
|
103
|
+
and node.value.value == "Union"
|
|
104
|
+
):
|
|
105
|
+
# Handle both list and tuple slice formats
|
|
106
|
+
slice_elements = (
|
|
107
|
+
node.slice if isinstance(node.slice, (list, tuple)) else [node.slice]
|
|
108
|
+
)
|
|
109
|
+
for element in slice_elements:
|
|
110
|
+
if (
|
|
111
|
+
isinstance(element, cst.SubscriptElement)
|
|
112
|
+
and isinstance(element.slice, cst.Index)
|
|
113
|
+
and isinstance(element.slice.value, cst.Name)
|
|
114
|
+
and element.slice.value.value == "None"
|
|
115
|
+
):
|
|
116
|
+
return True
|
|
117
|
+
|
|
118
|
+
return False
|
{strawberry_graphql-0.279.0.dev1754159379 → strawberry_graphql-0.280.0}/strawberry/django/views.py
RENAMED
|
@@ -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
|
|