strawberry-graphql 0.266.0.dev1744797470__tar.gz → 0.266.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.266.0.dev1744797470 → strawberry_graphql-0.266.1}/PKG-INFO +1 -1
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/pyproject.toml +1 -1
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/__init__.py +3 -2
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/annotation.py +8 -5
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/federation/enum.py +7 -1
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/http/__init__.py +9 -14
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/http/async_base_view.py +5 -81
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/printer/printer.py +2 -2
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/schema/config.py +0 -1
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/schema/schema.py +7 -47
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/schema/schema_converter.py +8 -3
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/static/graphiql.html +5 -5
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/types/arguments.py +13 -4
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/types/base.py +10 -1
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/types/enum.py +11 -3
- strawberry_graphql-0.266.1/strawberry/types/maybe.py +47 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/types/object_type.py +12 -1
- strawberry_graphql-0.266.0.dev1744797470/strawberry/schema/_graphql_core.py +0 -46
- strawberry_graphql-0.266.0.dev1744797470/strawberry/streamable.py +0 -36
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/LICENSE +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/README.md +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/__main__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/aiohttp/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/aiohttp/test/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/aiohttp/test/client.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/aiohttp/views.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/asgi/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/asgi/test/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/asgi/test/client.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/chalice/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/chalice/views.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/channels/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/channels/handlers/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/channels/handlers/base.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/channels/handlers/http_handler.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/channels/handlers/ws_handler.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/channels/router.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/channels/testing.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/cli/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/cli/app.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/cli/commands/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/cli/commands/codegen.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/cli/commands/export_schema.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/cli/commands/schema_codegen.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/cli/commands/server.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/cli/commands/upgrade/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/cli/commands/upgrade/_fake_progress.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/cli/commands/upgrade/_run_codemod.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/cli/constants.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/cli/debug_server.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/cli/utils/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/cli/utils/load_schema.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/codegen/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/codegen/exceptions.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/codegen/plugins/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/codegen/plugins/print_operation.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/codegen/plugins/python.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/codegen/plugins/typescript.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/codegen/query_codegen.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/codegen/types.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/codemods/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/codemods/annotated_unions.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/codemods/update_imports.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/dataloader.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/directive.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/django/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/django/apps.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/django/context.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/django/test/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/django/test/client.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/django/views.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/exceptions/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/exceptions/conflicting_arguments.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/exceptions/duplicated_type_name.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/exceptions/exception.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/exceptions/exception_source.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/exceptions/handler.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/exceptions/invalid_argument_type.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/exceptions/invalid_union_type.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/exceptions/missing_arguments_annotations.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/exceptions/missing_dependencies.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/exceptions/missing_field_annotation.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/exceptions/missing_return_annotation.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/exceptions/object_is_not_a_class.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/exceptions/object_is_not_an_enum.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/exceptions/permission_fail_silently_requires_optional.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/exceptions/private_strawberry_field.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/exceptions/scalar_already_registered.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/exceptions/syntax.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/exceptions/unresolved_field_type.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/exceptions/utils/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/exceptions/utils/source_finder.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/experimental/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/experimental/pydantic/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/experimental/pydantic/_compat.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/experimental/pydantic/conversion.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/experimental/pydantic/conversion_types.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/experimental/pydantic/error_type.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/experimental/pydantic/exceptions.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/experimental/pydantic/fields.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/experimental/pydantic/object_type.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/experimental/pydantic/utils.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/ext/LICENSE +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/ext/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/ext/dataclasses/LICENSE +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/ext/dataclasses/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/ext/dataclasses/dataclasses.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/ext/mypy_plugin.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/extensions/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/extensions/add_validation_rules.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/extensions/base_extension.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/extensions/context.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/extensions/directives.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/extensions/disable_validation.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/extensions/field_extension.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/extensions/mask_errors.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/extensions/max_aliases.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/extensions/max_tokens.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/extensions/parser_cache.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/extensions/pyinstrument.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/extensions/query_depth_limiter.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/extensions/runner.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/extensions/tracing/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/extensions/tracing/apollo.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/extensions/tracing/datadog.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/extensions/tracing/opentelemetry.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/extensions/tracing/utils.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/extensions/utils.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/extensions/validation_cache.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/fastapi/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/fastapi/context.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/fastapi/router.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/federation/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/federation/argument.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/federation/field.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/federation/mutation.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/federation/object_type.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/federation/scalar.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/federation/schema.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/federation/schema_directive.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/federation/schema_directives.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/federation/types.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/federation/union.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/field_extensions/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/field_extensions/input_mutation.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/file_uploads/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/file_uploads/scalars.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/file_uploads/utils.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/flask/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/flask/views.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/http/base.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/http/exceptions.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/http/ides.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/http/parse_content_type.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/http/sync_base_view.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/http/temporal_response.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/http/types.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/http/typevars.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/litestar/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/litestar/controller.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/parent.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/permission.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/printer/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/printer/ast_from_value.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/py.typed +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/quart/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/quart/views.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/relay/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/relay/exceptions.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/relay/fields.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/relay/types.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/relay/utils.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/resolvers.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/sanic/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/sanic/context.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/sanic/utils.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/sanic/views.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/scalars.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/schema/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/schema/base.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/schema/compat.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/schema/exceptions.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/schema/name_converter.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/schema/types/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/schema/types/base_scalars.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/schema/types/concrete_type.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/schema/types/scalar.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/schema/validation_rules/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/schema/validation_rules/one_of.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/schema_codegen/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/schema_directive.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/schema_directives.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/static/apollo-sandbox.html +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/static/pathfinder.html +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/subscriptions/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/subscriptions/protocols/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/subscriptions/protocols/graphql_transport_ws/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/subscriptions/protocols/graphql_transport_ws/handlers.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/subscriptions/protocols/graphql_transport_ws/types.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/subscriptions/protocols/graphql_ws/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/subscriptions/protocols/graphql_ws/handlers.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/subscriptions/protocols/graphql_ws/types.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/test/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/test/client.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/tools/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/tools/create_type.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/tools/merge_types.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/types/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/types/auto.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/types/cast.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/types/execution.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/types/field.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/types/fields/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/types/fields/resolver.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/types/graphql.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/types/info.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/types/lazy_type.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/types/mutation.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/types/nodes.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/types/private.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/types/scalar.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/types/type_resolver.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/types/union.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/types/unset.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/utils/__init__.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/utils/aio.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/utils/await_maybe.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/utils/dataclasses.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/utils/debug.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/utils/deprecations.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/utils/graphql_lexer.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/utils/importer.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/utils/inspect.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/utils/logging.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/utils/operation.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/utils/str_converters.py +0 -0
- {strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/utils/typing.py +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "strawberry-graphql"
|
3
3
|
packages = [ { include = "strawberry" } ]
|
4
|
-
version = "0.266.
|
4
|
+
version = "0.266.1"
|
5
5
|
description = "A library for creating GraphQL APIs"
|
6
6
|
authors = ["Patrick Arminio <patrick.arminio@gmail.com>"]
|
7
7
|
license = "MIT"
|
{strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/__init__.py
RENAMED
@@ -11,7 +11,6 @@ from .permission import BasePermission
|
|
11
11
|
from .scalars import ID
|
12
12
|
from .schema import Schema
|
13
13
|
from .schema_directive import schema_directive
|
14
|
-
from .streamable import Streamable
|
15
14
|
from .types.arguments import argument
|
16
15
|
from .types.auto import auto
|
17
16
|
from .types.cast import cast
|
@@ -19,6 +18,7 @@ from .types.enum import enum, enum_value
|
|
19
18
|
from .types.field import field
|
20
19
|
from .types.info import Info
|
21
20
|
from .types.lazy_type import LazyType, lazy
|
21
|
+
from .types.maybe import Maybe, Some
|
22
22
|
from .types.mutation import mutation, subscription
|
23
23
|
from .types.object_type import asdict, input, interface, type # noqa: A004
|
24
24
|
from .types.private import Private
|
@@ -32,10 +32,11 @@ __all__ = [
|
|
32
32
|
"BasePermission",
|
33
33
|
"Info",
|
34
34
|
"LazyType",
|
35
|
+
"Maybe",
|
35
36
|
"Parent",
|
36
37
|
"Private",
|
37
38
|
"Schema",
|
38
|
-
"
|
39
|
+
"Some",
|
39
40
|
"argument",
|
40
41
|
"asdict",
|
41
42
|
"auto",
|
{strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/annotation.py
RENAMED
@@ -17,9 +17,9 @@ from typing import (
|
|
17
17
|
)
|
18
18
|
from typing_extensions import Self, get_args, get_origin
|
19
19
|
|
20
|
-
from strawberry.streamable import StrawberryStreamable
|
21
20
|
from strawberry.types.base import (
|
22
21
|
StrawberryList,
|
22
|
+
StrawberryMaybe,
|
23
23
|
StrawberryObjectDefinition,
|
24
24
|
StrawberryOptional,
|
25
25
|
StrawberryTypeVar,
|
@@ -29,6 +29,7 @@ from strawberry.types.base import (
|
|
29
29
|
from strawberry.types.enum import EnumDefinition
|
30
30
|
from strawberry.types.enum import enum as strawberry_enum
|
31
31
|
from strawberry.types.lazy_type import LazyType
|
32
|
+
from strawberry.types.maybe import _annotation_is_maybe
|
32
33
|
from strawberry.types.private import is_private
|
33
34
|
from strawberry.types.scalar import ScalarDefinition
|
34
35
|
from strawberry.types.unset import UNSET
|
@@ -142,10 +143,12 @@ class StrawberryAnnotation:
|
|
142
143
|
|
143
144
|
if self._is_lazy_type(evaled_type):
|
144
145
|
return evaled_type
|
145
|
-
if self._is_streamable(evaled_type, args):
|
146
|
-
return self.create_list(list[evaled_type])
|
147
146
|
if self._is_list(evaled_type):
|
148
147
|
return self.create_list(evaled_type)
|
148
|
+
if type_of := self._get_maybe_type(evaled_type):
|
149
|
+
return StrawberryMaybe(
|
150
|
+
of_type=type_of,
|
151
|
+
)
|
149
152
|
|
150
153
|
if self._is_graphql_generic(evaled_type):
|
151
154
|
if any(is_type_var(type_) for type_ in get_args(evaled_type)):
|
@@ -317,8 +320,8 @@ class StrawberryAnnotation:
|
|
317
320
|
)
|
318
321
|
|
319
322
|
@classmethod
|
320
|
-
def
|
321
|
-
return
|
323
|
+
def _get_maybe_type(cls, annotation: Any) -> type | None:
|
324
|
+
return get_args(annotation)[0] if _annotation_is_maybe(annotation) else None
|
322
325
|
|
323
326
|
@classmethod
|
324
327
|
def _is_strawberry_type(cls, evaled_type: Any) -> bool:
|
@@ -20,6 +20,7 @@ if TYPE_CHECKING:
|
|
20
20
|
|
21
21
|
def enum_value(
|
22
22
|
value: Any,
|
23
|
+
name: Optional[str] = None,
|
23
24
|
deprecation_reason: Optional[str] = None,
|
24
25
|
directives: Iterable[object] = (),
|
25
26
|
inaccessible: bool = False,
|
@@ -35,7 +36,12 @@ def enum_value(
|
|
35
36
|
if tags:
|
36
37
|
directives.extend(Tag(name=tag) for tag in tags)
|
37
38
|
|
38
|
-
return base_enum_value(
|
39
|
+
return base_enum_value(
|
40
|
+
value=value,
|
41
|
+
name=name,
|
42
|
+
deprecation_reason=deprecation_reason,
|
43
|
+
directives=directives,
|
44
|
+
)
|
39
45
|
|
40
46
|
|
41
47
|
@overload
|
{strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/http/__init__.py
RENAMED
@@ -1,13 +1,11 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
3
|
from dataclasses import dataclass
|
4
|
-
from typing import Any, Optional
|
4
|
+
from typing import TYPE_CHECKING, Any, Optional
|
5
5
|
from typing_extensions import Literal, TypedDict
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
ResultType,
|
10
|
-
)
|
7
|
+
if TYPE_CHECKING:
|
8
|
+
from strawberry.types import ExecutionResult
|
11
9
|
|
12
10
|
|
13
11
|
class GraphQLHTTPResponse(TypedDict, total=False):
|
@@ -16,16 +14,13 @@ class GraphQLHTTPResponse(TypedDict, total=False):
|
|
16
14
|
extensions: Optional[dict[str, object]]
|
17
15
|
|
18
16
|
|
19
|
-
def process_result(result:
|
20
|
-
|
21
|
-
return result
|
17
|
+
def process_result(result: ExecutionResult) -> GraphQLHTTPResponse:
|
18
|
+
data: GraphQLHTTPResponse = {"data": result.data}
|
22
19
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
**({"extensions": extensions} if extensions else {}),
|
28
|
-
}
|
20
|
+
if result.errors:
|
21
|
+
data["errors"] = [err.formatted for err in result.errors]
|
22
|
+
if result.extensions:
|
23
|
+
data["extensions"] = result.extensions
|
29
24
|
|
30
25
|
return data
|
31
26
|
|
@@ -25,9 +25,6 @@ from strawberry.http import (
|
|
25
25
|
process_result,
|
26
26
|
)
|
27
27
|
from strawberry.http.ides import GraphQL_IDE
|
28
|
-
from strawberry.schema._graphql_core import (
|
29
|
-
GraphQLIncrementalExecutionResults,
|
30
|
-
)
|
31
28
|
from strawberry.schema.base import BaseSchema
|
32
29
|
from strawberry.schema.exceptions import InvalidOperationTypeError
|
33
30
|
from strawberry.subscriptions import GRAPHQL_TRANSPORT_WS_PROTOCOL, GRAPHQL_WS_PROTOCOL
|
@@ -261,7 +258,7 @@ class AsyncBaseHTTPView(
|
|
261
258
|
root_value: Optional[RootValue] = UNSET,
|
262
259
|
) -> WebSocketResponse: ...
|
263
260
|
|
264
|
-
async def run(
|
261
|
+
async def run(
|
265
262
|
self,
|
266
263
|
request: Union[Request, WebSocketRequest],
|
267
264
|
context: Optional[Context] = UNSET,
|
@@ -352,75 +349,6 @@ class AsyncBaseHTTPView(
|
|
352
349
|
"Content-Type": "multipart/mixed;boundary=graphql;subscriptionSpec=1.0,application/json",
|
353
350
|
},
|
354
351
|
)
|
355
|
-
if isinstance(result, GraphQLIncrementalExecutionResults):
|
356
|
-
|
357
|
-
async def stream() -> AsyncGenerator[str, None]:
|
358
|
-
yield "---"
|
359
|
-
|
360
|
-
response = await self.process_result(request, result.initial_result)
|
361
|
-
|
362
|
-
response["hasNext"] = result.initial_result.has_next
|
363
|
-
response["pending"] = [
|
364
|
-
p.formatted for p in result.initial_result.pending
|
365
|
-
]
|
366
|
-
response["extensions"] = result.initial_result.extensions
|
367
|
-
|
368
|
-
yield self.encode_multipart_data(response, "-")
|
369
|
-
|
370
|
-
all_pending = result.initial_result.pending
|
371
|
-
|
372
|
-
async for value in result.subsequent_results:
|
373
|
-
response = {
|
374
|
-
"hasNext": value.has_next,
|
375
|
-
"extensions": value.extensions,
|
376
|
-
}
|
377
|
-
|
378
|
-
if value.pending:
|
379
|
-
response["pending"] = [p.formatted for p in value.pending]
|
380
|
-
|
381
|
-
if value.completed:
|
382
|
-
response["completed"] = [p.formatted for p in value.completed]
|
383
|
-
|
384
|
-
if value.incremental:
|
385
|
-
incremental = []
|
386
|
-
|
387
|
-
all_pending.extend(value.pending)
|
388
|
-
|
389
|
-
for incremental_value in value.incremental:
|
390
|
-
pending_value = next(
|
391
|
-
(
|
392
|
-
v
|
393
|
-
for v in all_pending
|
394
|
-
if v.id == incremental_value.id
|
395
|
-
),
|
396
|
-
None,
|
397
|
-
)
|
398
|
-
|
399
|
-
assert pending_value
|
400
|
-
|
401
|
-
incremental.append(
|
402
|
-
{
|
403
|
-
**incremental_value.formatted,
|
404
|
-
"path": pending_value.path,
|
405
|
-
"label": pending_value.label,
|
406
|
-
}
|
407
|
-
)
|
408
|
-
|
409
|
-
response["incremental"] = incremental
|
410
|
-
|
411
|
-
yield self.encode_multipart_data(response, "-")
|
412
|
-
|
413
|
-
yield "--\r\n"
|
414
|
-
|
415
|
-
return await self.create_streaming_response(
|
416
|
-
request,
|
417
|
-
stream,
|
418
|
-
sub_response,
|
419
|
-
headers={
|
420
|
-
"Transfer-Encoding": "chunked",
|
421
|
-
"Content-Type": 'multipart/mixed; boundary="-"',
|
422
|
-
},
|
423
|
-
)
|
424
352
|
|
425
353
|
response_data = await self.process_result(request=request, result=result)
|
426
354
|
|
@@ -432,16 +360,12 @@ class AsyncBaseHTTPView(
|
|
432
360
|
)
|
433
361
|
|
434
362
|
def encode_multipart_data(self, data: Any, separator: str) -> str:
|
435
|
-
encoded_data = self.encode_json(data)
|
436
|
-
|
437
363
|
return "".join(
|
438
364
|
[
|
439
|
-
"\r\n",
|
440
|
-
"Content-Type: application/json
|
441
|
-
|
442
|
-
"\
|
443
|
-
encoded_data,
|
444
|
-
f"\r\n--{separator}",
|
365
|
+
f"\r\n--{separator}\r\n",
|
366
|
+
"Content-Type: application/json\r\n\r\n",
|
367
|
+
self.encode_json(data),
|
368
|
+
"\n",
|
445
369
|
]
|
446
370
|
)
|
447
371
|
|
@@ -561,9 +561,9 @@ def print_schema_definition(
|
|
561
561
|
def print_directive(
|
562
562
|
directive: GraphQLDirective, *, schema: BaseSchema
|
563
563
|
) -> Optional[str]:
|
564
|
-
strawberry_directive = directive.extensions
|
564
|
+
strawberry_directive = directive.extensions["strawberry-definition"]
|
565
565
|
|
566
|
-
if
|
566
|
+
if (
|
567
567
|
isinstance(strawberry_directive, StrawberrySchemaDirective)
|
568
568
|
and not strawberry_directive.print_definition
|
569
569
|
):
|
{strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/schema/schema.py
RENAMED
@@ -29,6 +29,8 @@ from graphql import (
|
|
29
29
|
parse,
|
30
30
|
validate_schema,
|
31
31
|
)
|
32
|
+
from graphql.execution import ExecutionContext as GraphQLExecutionContext
|
33
|
+
from graphql.execution import execute, subscribe
|
32
34
|
from graphql.execution.middleware import MiddlewareManager
|
33
35
|
from graphql.type.directives import specified_directives
|
34
36
|
from graphql.validation import validate
|
@@ -62,15 +64,6 @@ from strawberry.utils.aio import aclosing
|
|
62
64
|
from strawberry.utils.await_maybe import await_maybe
|
63
65
|
|
64
66
|
from . import compat
|
65
|
-
from ._graphql_core import (
|
66
|
-
GraphQLExecutionContext,
|
67
|
-
GraphQLIncrementalExecutionResults,
|
68
|
-
ResultType,
|
69
|
-
execute,
|
70
|
-
experimental_execute_incrementally,
|
71
|
-
incremental_execution_directives,
|
72
|
-
subscribe,
|
73
|
-
)
|
74
67
|
from .base import BaseSchema
|
75
68
|
from .config import StrawberryConfig
|
76
69
|
from .exceptions import InvalidOperationTypeError
|
@@ -99,7 +92,6 @@ OriginSubscriptionResult = Union[
|
|
99
92
|
AsyncIterator[OriginalExecutionResult],
|
100
93
|
]
|
101
94
|
|
102
|
-
|
103
95
|
DEFAULT_ALLOWED_OPERATION_TYPES = {
|
104
96
|
OperationType.QUERY,
|
105
97
|
OperationType.MUTATION,
|
@@ -270,16 +262,11 @@ class Schema(BaseSchema):
|
|
270
262
|
graphql_types.append(graphql_type)
|
271
263
|
|
272
264
|
try:
|
273
|
-
directives = specified_directives + tuple(graphql_directives)
|
274
|
-
|
275
|
-
if self.config.enable_experimental_incremental_execution:
|
276
|
-
directives = tuple(directives) + tuple(incremental_execution_directives)
|
277
|
-
|
278
265
|
self._schema = GraphQLSchema(
|
279
266
|
query=query_type,
|
280
267
|
mutation=mutation_type,
|
281
268
|
subscription=subscription_type if subscription else None,
|
282
|
-
directives=
|
269
|
+
directives=specified_directives + tuple(graphql_directives),
|
283
270
|
types=graphql_types,
|
284
271
|
extensions={
|
285
272
|
GraphQLCoreConverter.DEFINITION_BACKREF: self,
|
@@ -457,16 +444,12 @@ class Schema(BaseSchema):
|
|
457
444
|
async def _handle_execution_result(
|
458
445
|
self,
|
459
446
|
context: ExecutionContext,
|
460
|
-
result:
|
447
|
+
result: Union[GraphQLExecutionResult, ExecutionResult],
|
461
448
|
extensions_runner: SchemaExtensionsRunner,
|
462
449
|
*,
|
463
450
|
# TODO: can we remove this somehow, see comment in execute
|
464
451
|
skip_process_errors: bool = False,
|
465
452
|
) -> ExecutionResult:
|
466
|
-
# TODO: handle this, also, why do we have both GraphQLExecutionResult and ExecutionResult?
|
467
|
-
if isinstance(result, GraphQLIncrementalExecutionResults):
|
468
|
-
return result
|
469
|
-
|
470
453
|
# Set errors on the context so that it's easier
|
471
454
|
# to access in extensions
|
472
455
|
if result.errors:
|
@@ -507,17 +490,6 @@ class Schema(BaseSchema):
|
|
507
490
|
extensions_runner = self.create_extensions_runner(execution_context, extensions)
|
508
491
|
middleware_manager = self._get_middleware_manager(extensions)
|
509
492
|
|
510
|
-
execute_function = execute
|
511
|
-
|
512
|
-
if self.config.enable_experimental_incremental_execution:
|
513
|
-
execute_function = experimental_execute_incrementally
|
514
|
-
|
515
|
-
if execute_function is None:
|
516
|
-
raise RuntimeError(
|
517
|
-
"Incremental execution is enabled but experimental_execute_incrementally is not available, "
|
518
|
-
"please install graphql-core>=3.3.0"
|
519
|
-
)
|
520
|
-
|
521
493
|
try:
|
522
494
|
async with extensions_runner.operation():
|
523
495
|
# Note: In graphql-core the schema would be validated here but in
|
@@ -536,7 +508,7 @@ class Schema(BaseSchema):
|
|
536
508
|
async with extensions_runner.executing():
|
537
509
|
if not execution_context.result:
|
538
510
|
result = await await_maybe(
|
539
|
-
|
511
|
+
execute(
|
540
512
|
self._schema,
|
541
513
|
execution_context.graphql_document,
|
542
514
|
root_value=execution_context.root_value,
|
@@ -552,9 +524,7 @@ class Schema(BaseSchema):
|
|
552
524
|
result = execution_context.result
|
553
525
|
# Also set errors on the execution_context so that it's easier
|
554
526
|
# to access in extensions
|
555
|
-
|
556
|
-
# TODO: maybe here use the first result from incremental execution if it exists
|
557
|
-
if isinstance(result, GraphQLExecutionResult) and result.errors:
|
527
|
+
if result.errors:
|
558
528
|
execution_context.errors = result.errors
|
559
529
|
|
560
530
|
# Run the `Schema.process_errors` function here before
|
@@ -604,16 +574,6 @@ class Schema(BaseSchema):
|
|
604
574
|
extensions_runner = self.create_extensions_runner(execution_context, extensions)
|
605
575
|
middleware_manager = self._get_middleware_manager(extensions)
|
606
576
|
|
607
|
-
execute_function = execute
|
608
|
-
|
609
|
-
if self.config.enable_experimental_incremental_execution:
|
610
|
-
execute_function = experimental_execute_incrementally
|
611
|
-
|
612
|
-
if execute_function is None:
|
613
|
-
raise RuntimeError(
|
614
|
-
"Incremental execution is enabled but experimental_execute_incrementally is not available, "
|
615
|
-
"please install graphql-core>=3.3.0"
|
616
|
-
)
|
617
577
|
try:
|
618
578
|
with extensions_runner.operation():
|
619
579
|
# Note: In graphql-core the schema would be validated here but in
|
@@ -655,7 +615,7 @@ class Schema(BaseSchema):
|
|
655
615
|
|
656
616
|
with extensions_runner.executing():
|
657
617
|
if not execution_context.result:
|
658
|
-
result =
|
618
|
+
result = execute(
|
659
619
|
self._schema,
|
660
620
|
execution_context.graphql_document,
|
661
621
|
root_value=execution_context.root_value,
|
@@ -52,6 +52,7 @@ from strawberry.schema.types.scalar import _make_scalar_type
|
|
52
52
|
from strawberry.types.arguments import StrawberryArgument, convert_arguments
|
53
53
|
from strawberry.types.base import (
|
54
54
|
StrawberryList,
|
55
|
+
StrawberryMaybe,
|
55
56
|
StrawberryObjectDefinition,
|
56
57
|
StrawberryOptional,
|
57
58
|
StrawberryType,
|
@@ -254,7 +255,10 @@ class GraphQLCoreConverter:
|
|
254
255
|
argument_type = cast(
|
255
256
|
"GraphQLInputType", self.from_maybe_optional(argument.type)
|
256
257
|
)
|
257
|
-
|
258
|
+
if argument.is_maybe:
|
259
|
+
default_value: Any = Undefined
|
260
|
+
else:
|
261
|
+
default_value = Undefined if argument.default is UNSET else argument.default
|
258
262
|
|
259
263
|
return GraphQLArgument(
|
260
264
|
type_=argument_type,
|
@@ -419,8 +423,9 @@ class GraphQLCoreConverter:
|
|
419
423
|
),
|
420
424
|
)
|
421
425
|
default_value: object
|
422
|
-
|
423
|
-
|
426
|
+
if isinstance(field.type, StrawberryMaybe):
|
427
|
+
default_value = Undefined
|
428
|
+
elif field.default_value is UNSET or field.default_value is dataclasses.MISSING:
|
424
429
|
default_value = Undefined
|
425
430
|
else:
|
426
431
|
default_value = field.default_value
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<!
|
1
|
+
<!DOCTYPE html>
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<title>Strawberry GraphiQL</title>
|
@@ -61,8 +61,8 @@
|
|
61
61
|
<link
|
62
62
|
crossorigin
|
63
63
|
rel="stylesheet"
|
64
|
-
href="https://unpkg.com/graphiql@3.
|
65
|
-
integrity="sha384-
|
64
|
+
href="https://unpkg.com/graphiql@3.0.9/graphiql.min.css"
|
65
|
+
integrity="sha384-yz3/sqpuplkA7msMo0FE4ekg0xdwdvZ8JX9MVZREsxipqjU4h8IRfmAMRcb1QpUy"
|
66
66
|
/>
|
67
67
|
|
68
68
|
<link
|
@@ -77,8 +77,8 @@
|
|
77
77
|
<div id="graphiql" class="graphiql-container">Loading...</div>
|
78
78
|
<script
|
79
79
|
crossorigin
|
80
|
-
src="https://unpkg.com/graphiql@3.
|
81
|
-
integrity="sha384-
|
80
|
+
src="https://unpkg.com/graphiql@3.0.9/graphiql.min.js"
|
81
|
+
integrity="sha384-Mjte+vxCWz1ZYCzszGHiJqJa5eAxiqI4mc3BErq7eDXnt+UGLXSEW7+i0wmfPiji"
|
82
82
|
></script>
|
83
83
|
<script
|
84
84
|
crossorigin
|
@@ -17,13 +17,17 @@ from strawberry.exceptions import MultipleStrawberryArgumentsError, UnsupportedT
|
|
17
17
|
from strawberry.scalars import is_scalar
|
18
18
|
from strawberry.types.base import (
|
19
19
|
StrawberryList,
|
20
|
+
StrawberryMaybe,
|
20
21
|
StrawberryOptional,
|
21
22
|
has_object_definition,
|
22
23
|
)
|
23
24
|
from strawberry.types.enum import EnumDefinition
|
24
25
|
from strawberry.types.lazy_type import LazyType, StrawberryLazyReference
|
26
|
+
from strawberry.types.maybe import Some
|
25
27
|
from strawberry.types.unset import UNSET as _deprecated_UNSET # noqa: N811
|
26
|
-
from strawberry.types.unset import
|
28
|
+
from strawberry.types.unset import (
|
29
|
+
_deprecated_is_unset, # noqa: F401
|
30
|
+
)
|
27
31
|
|
28
32
|
if TYPE_CHECKING:
|
29
33
|
from collections.abc import Iterable, Mapping
|
@@ -135,6 +139,10 @@ class StrawberryArgument:
|
|
135
139
|
|
136
140
|
return is_graphql_generic(self.type)
|
137
141
|
|
142
|
+
@property
|
143
|
+
def is_maybe(self) -> bool:
|
144
|
+
return isinstance(self.type, StrawberryMaybe)
|
145
|
+
|
138
146
|
|
139
147
|
def convert_argument(
|
140
148
|
value: object,
|
@@ -143,6 +151,10 @@ def convert_argument(
|
|
143
151
|
config: StrawberryConfig,
|
144
152
|
) -> object:
|
145
153
|
# TODO: move this somewhere else and make it first class
|
154
|
+
if isinstance(type_, StrawberryOptional):
|
155
|
+
res = convert_argument(value, type_.of_type, scalar_registry, config)
|
156
|
+
|
157
|
+
return Some(res) if isinstance(type_, StrawberryMaybe) else res
|
146
158
|
|
147
159
|
if value is None:
|
148
160
|
return None
|
@@ -150,9 +162,6 @@ def convert_argument(
|
|
150
162
|
if value is _deprecated_UNSET:
|
151
163
|
return _deprecated_UNSET
|
152
164
|
|
153
|
-
if isinstance(type_, StrawberryOptional):
|
154
|
-
return convert_argument(value, type_.of_type, scalar_registry, config)
|
155
|
-
|
156
165
|
if isinstance(type_, StrawberryList):
|
157
166
|
value_list = cast("Iterable", value)
|
158
167
|
return [
|
{strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/types/base.py
RENAMED
@@ -152,7 +152,16 @@ class StrawberryContainer(StrawberryType):
|
|
152
152
|
class StrawberryList(StrawberryContainer): ...
|
153
153
|
|
154
154
|
|
155
|
-
class StrawberryOptional(StrawberryContainer):
|
155
|
+
class StrawberryOptional(StrawberryContainer):
|
156
|
+
def __init__(
|
157
|
+
self,
|
158
|
+
of_type: Union[StrawberryType, type[WithStrawberryObjectDefinition], type],
|
159
|
+
) -> None:
|
160
|
+
super().__init__(of_type)
|
161
|
+
|
162
|
+
|
163
|
+
class StrawberryMaybe(StrawberryOptional):
|
164
|
+
pass
|
156
165
|
|
157
166
|
|
158
167
|
class StrawberryTypeVar(StrawberryType):
|
{strawberry_graphql-0.266.0.dev1744797470 → strawberry_graphql-0.266.1}/strawberry/types/enum.py
RENAMED
@@ -50,6 +50,7 @@ class EnumDefinition(StrawberryType):
|
|
50
50
|
@dataclasses.dataclass
|
51
51
|
class EnumValueDefinition:
|
52
52
|
value: Any
|
53
|
+
graphql_name: Optional[str] = None
|
53
54
|
deprecation_reason: Optional[str] = None
|
54
55
|
directives: Iterable[object] = ()
|
55
56
|
description: Optional[str] = None
|
@@ -60,6 +61,7 @@ class EnumValueDefinition:
|
|
60
61
|
|
61
62
|
def enum_value(
|
62
63
|
value: Any,
|
64
|
+
name: Optional[str] = None,
|
63
65
|
deprecation_reason: Optional[str] = None,
|
64
66
|
directives: Iterable[object] = (),
|
65
67
|
description: Optional[str] = None,
|
@@ -68,6 +70,7 @@ def enum_value(
|
|
68
70
|
|
69
71
|
Args:
|
70
72
|
value: The value of the enum member.
|
73
|
+
name: The GraphQL name of the enum member.
|
71
74
|
deprecation_reason: The deprecation reason of the enum member,
|
72
75
|
setting this will mark the enum member as deprecated.
|
73
76
|
directives: The directives to attach to the enum member.
|
@@ -90,6 +93,7 @@ def enum_value(
|
|
90
93
|
"""
|
91
94
|
return EnumValueDefinition(
|
92
95
|
value=value,
|
96
|
+
graphql_name=name,
|
93
97
|
deprecation_reason=deprecation_reason,
|
94
98
|
directives=directives,
|
95
99
|
description=description,
|
@@ -123,12 +127,16 @@ def _process_enum(
|
|
123
127
|
item_directives = item_value.directives
|
124
128
|
enum_value_description = item_value.description
|
125
129
|
deprecation_reason = item_value.deprecation_reason
|
126
|
-
item_value = item_value.value
|
127
130
|
|
128
131
|
# update _value2member_map_ so that doing `MyEnum.MY_VALUE` and
|
129
132
|
# `MyEnum['MY_VALUE']` both work
|
130
|
-
cls._value2member_map_[item_value] = item
|
131
|
-
cls._member_map_[item_name]._value_ = item_value
|
133
|
+
cls._value2member_map_[item_value.value] = item
|
134
|
+
cls._member_map_[item_name]._value_ = item_value.value
|
135
|
+
|
136
|
+
if item_value.graphql_name:
|
137
|
+
item_name = item_value.graphql_name
|
138
|
+
|
139
|
+
item_value = item_value.value
|
132
140
|
|
133
141
|
value = EnumValue(
|
134
142
|
item_name,
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import typing
|
2
|
+
from typing import TYPE_CHECKING, Any, Generic, TypeVar, Union
|
3
|
+
from typing_extensions import TypeAlias
|
4
|
+
|
5
|
+
T = TypeVar("T")
|
6
|
+
|
7
|
+
|
8
|
+
class Some(Generic[T]):
|
9
|
+
"""A special value that can be used to represent an unset value in a field or argument.
|
10
|
+
|
11
|
+
Similar to `undefined` in JavaScript, this value can be used to differentiate between
|
12
|
+
a field that was not set and a field that was set to `None` or `null`.
|
13
|
+
"""
|
14
|
+
|
15
|
+
__slots__ = ("value",)
|
16
|
+
|
17
|
+
def __init__(self, value: T) -> None:
|
18
|
+
self.value = value
|
19
|
+
|
20
|
+
def __repr__(self) -> str:
|
21
|
+
return f"Some({self.value!r})"
|
22
|
+
|
23
|
+
def __eq__(self, other: object) -> bool:
|
24
|
+
return self.value == other.value if isinstance(other, Some) else False
|
25
|
+
|
26
|
+
def __hash__(self) -> int:
|
27
|
+
return hash(self.value)
|
28
|
+
|
29
|
+
def __bool__(self) -> bool:
|
30
|
+
return True
|
31
|
+
|
32
|
+
|
33
|
+
if TYPE_CHECKING:
|
34
|
+
Maybe: TypeAlias = Union[Some[Union[T, None]], None]
|
35
|
+
else:
|
36
|
+
# we do this trick so we can inspect that at runtime
|
37
|
+
class Maybe(Generic[T]): ...
|
38
|
+
|
39
|
+
|
40
|
+
def _annotation_is_maybe(annotation: Any) -> bool:
|
41
|
+
return (orig := typing.get_origin(annotation)) and orig is Maybe
|
42
|
+
|
43
|
+
|
44
|
+
__all__ = [
|
45
|
+
"Maybe",
|
46
|
+
"Some",
|
47
|
+
]
|