strawberry-graphql 0.225.0__tar.gz → 0.226.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.225.0 → strawberry_graphql-0.226.1}/PKG-INFO +1 -1
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/pyproject.toml +1 -1
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/ext/mypy_plugin.py +12 -1
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/http/async_base_view.py +3 -3
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/http/sync_base_view.py +3 -3
- strawberry_graphql-0.226.1/strawberry/schema/execute.py +274 -0
- strawberry_graphql-0.225.0/strawberry/schema/execute.py +0 -263
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/LICENSE +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/README.md +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/__main__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/aiohttp/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/aiohttp/handlers/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/aiohttp/handlers/graphql_transport_ws_handler.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/aiohttp/handlers/graphql_ws_handler.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/aiohttp/test/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/aiohttp/test/client.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/aiohttp/views.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/annotation.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/arguments.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/asgi/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/asgi/handlers/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/asgi/handlers/graphql_transport_ws_handler.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/asgi/handlers/graphql_ws_handler.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/asgi/test/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/asgi/test/client.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/auto.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/chalice/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/chalice/views.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/channels/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/channels/handlers/base.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/channels/handlers/graphql_transport_ws_handler.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/channels/handlers/graphql_ws_handler.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/channels/handlers/http_handler.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/channels/handlers/ws_handler.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/channels/router.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/channels/testing.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/cli/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/cli/app.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/cli/commands/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/cli/commands/codegen.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/cli/commands/export_schema.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/cli/commands/schema_codegen.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/cli/commands/server.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/cli/commands/upgrade/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/cli/commands/upgrade/_fake_progress.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/cli/commands/upgrade/_run_codemod.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/cli/constants.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/cli/debug_server.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/cli/utils/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/cli/utils/load_schema.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/codegen/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/codegen/exceptions.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/codegen/plugins/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/codegen/plugins/print_operation.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/codegen/plugins/python.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/codegen/plugins/typescript.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/codegen/query_codegen.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/codegen/types.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/codemods/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/codemods/annotated_unions.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/custom_scalar.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/dataloader.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/directive.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/django/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/django/apps.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/django/context.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/django/test/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/django/test/client.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/django/views.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/enum.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/exceptions/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/exceptions/conflicting_arguments.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/exceptions/duplicated_type_name.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/exceptions/exception.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/exceptions/exception_source.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/exceptions/handler.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/exceptions/invalid_argument_type.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/exceptions/invalid_union_type.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/exceptions/missing_arguments_annotations.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/exceptions/missing_field_annotation.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/exceptions/missing_return_annotation.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/exceptions/not_a_strawberry_enum.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/exceptions/object_is_not_a_class.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/exceptions/object_is_not_an_enum.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/exceptions/permission_fail_silently_requires_optional.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/exceptions/private_strawberry_field.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/exceptions/scalar_already_registered.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/exceptions/syntax.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/exceptions/unresolved_field_type.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/exceptions/utils/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/exceptions/utils/source_finder.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/experimental/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/experimental/pydantic/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/experimental/pydantic/_compat.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/experimental/pydantic/conversion.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/experimental/pydantic/conversion_types.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/experimental/pydantic/error_type.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/experimental/pydantic/exceptions.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/experimental/pydantic/fields.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/experimental/pydantic/object_type.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/experimental/pydantic/utils.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/ext/LICENSE +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/ext/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/ext/dataclasses/LICENSE +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/ext/dataclasses/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/ext/dataclasses/dataclasses.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/extensions/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/extensions/add_validation_rules.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/extensions/base_extension.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/extensions/context.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/extensions/directives.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/extensions/disable_validation.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/extensions/field_extension.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/extensions/mask_errors.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/extensions/max_aliases.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/extensions/max_tokens.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/extensions/parser_cache.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/extensions/pyinstrument.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/extensions/query_depth_limiter.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/extensions/runner.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/extensions/tracing/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/extensions/tracing/apollo.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/extensions/tracing/datadog.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/extensions/tracing/opentelemetry.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/extensions/tracing/sentry.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/extensions/tracing/utils.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/extensions/utils.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/extensions/validation_cache.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/fastapi/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/fastapi/context.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/fastapi/handlers/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/fastapi/handlers/graphql_transport_ws_handler.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/fastapi/handlers/graphql_ws_handler.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/fastapi/router.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/federation/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/federation/argument.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/federation/enum.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/federation/field.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/federation/mutation.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/federation/object_type.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/federation/scalar.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/federation/schema.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/federation/schema_directive.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/federation/schema_directives.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/federation/types.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/federation/union.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/field.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/field_extensions/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/field_extensions/input_mutation.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/file_uploads/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/file_uploads/scalars.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/file_uploads/utils.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/flask/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/flask/views.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/http/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/http/base.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/http/exceptions.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/http/ides.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/http/temporal_response.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/http/types.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/http/typevars.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/lazy_type.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/litestar/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/litestar/controller.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/litestar/handlers/graphql_transport_ws_handler.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/litestar/handlers/graphql_ws_handler.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/mutation.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/object_type.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/parent.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/permission.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/printer/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/printer/ast_from_value.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/printer/printer.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/private.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/py.typed +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/quart/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/quart/views.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/relay/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/relay/exceptions.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/relay/fields.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/relay/types.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/relay/utils.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/resolvers.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/sanic/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/sanic/context.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/sanic/utils.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/sanic/views.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/scalars.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/schema/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/schema/base.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/schema/compat.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/schema/config.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/schema/exceptions.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/schema/name_converter.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/schema/schema.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/schema/schema_converter.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/schema/types/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/schema/types/base_scalars.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/schema/types/concrete_type.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/schema/types/scalar.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/schema_codegen/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/schema_directive.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/starlite/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/starlite/controller.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/starlite/handlers/graphql_transport_ws_handler.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/starlite/handlers/graphql_ws_handler.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/static/apollo-sandbox.html +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/static/graphiql.html +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/static/pathfinder.html +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/subscriptions/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/subscriptions/protocols/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/subscriptions/protocols/graphql_transport_ws/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/subscriptions/protocols/graphql_transport_ws/handlers.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/subscriptions/protocols/graphql_transport_ws/types.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/subscriptions/protocols/graphql_ws/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/subscriptions/protocols/graphql_ws/handlers.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/subscriptions/protocols/graphql_ws/types.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/test/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/test/client.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/tools/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/tools/create_type.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/tools/merge_types.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/type.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/types/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/types/execution.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/types/fields/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/types/fields/resolver.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/types/graphql.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/types/info.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/types/nodes.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/types/type_resolver.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/types/types.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/union.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/unset.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/utils/__init__.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/utils/aio.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/utils/await_maybe.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/utils/dataclasses.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/utils/debug.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/utils/deprecations.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/utils/graphql_lexer.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/utils/importer.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/utils/inspect.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/utils/logging.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/utils/operation.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/utils/str_converters.py +0 -0
- {strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/utils/typing.py +0 -0
@@ -487,12 +487,23 @@ def strawberry_pydantic_class_callback(ctx: ClassDefContext) -> None:
|
|
487
487
|
initializer=None,
|
488
488
|
kind=ARG_OPT,
|
489
489
|
)
|
490
|
+
extra_type = ctx.api.named_type(
|
491
|
+
"builtins.dict",
|
492
|
+
[ctx.api.named_type("builtins.str"), AnyType(TypeOfAny.explicit)],
|
493
|
+
)
|
494
|
+
|
495
|
+
extra_argument = Argument(
|
496
|
+
variable=Var(name="extra", type=UnionType([NoneType(), extra_type])),
|
497
|
+
type_annotation=UnionType([NoneType(), extra_type]),
|
498
|
+
initializer=None,
|
499
|
+
kind=ARG_OPT,
|
500
|
+
)
|
490
501
|
|
491
502
|
add_static_method_to_class(
|
492
503
|
ctx.api,
|
493
504
|
ctx.cls,
|
494
505
|
name="from_pydantic",
|
495
|
-
args=[model_argument],
|
506
|
+
args=[model_argument, extra_argument],
|
496
507
|
return_type=fill_typevars(ctx.cls.info),
|
497
508
|
)
|
498
509
|
|
{strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/http/async_base_view.py
RENAMED
@@ -206,12 +206,12 @@ class AsyncBaseHTTPView(
|
|
206
206
|
) -> GraphQLRequestData:
|
207
207
|
content_type = request.content_type or ""
|
208
208
|
|
209
|
-
if "
|
209
|
+
if request.method == "GET":
|
210
|
+
data = self.parse_query_params(request.query_params)
|
211
|
+
elif "application/json" in content_type:
|
210
212
|
data = self.parse_json(await request.get_body())
|
211
213
|
elif content_type.startswith("multipart/form-data"):
|
212
214
|
data = await self.parse_multipart(request)
|
213
|
-
elif request.method == "GET":
|
214
|
-
data = self.parse_query_params(request.query_params)
|
215
215
|
else:
|
216
216
|
raise HTTPException(400, "Unsupported content type")
|
217
217
|
|
@@ -146,12 +146,12 @@ class SyncBaseHTTPView(
|
|
146
146
|
def parse_http_body(self, request: SyncHTTPRequestAdapter) -> GraphQLRequestData:
|
147
147
|
content_type = request.content_type or ""
|
148
148
|
|
149
|
-
if "
|
149
|
+
if request.method == "GET":
|
150
|
+
data = self.parse_query_params(request.query_params)
|
151
|
+
elif "application/json" in content_type:
|
150
152
|
data = self.parse_json(request.body)
|
151
153
|
elif content_type.startswith("multipart/form-data"):
|
152
154
|
data = self.parse_multipart(request)
|
153
|
-
elif request.method == "GET":
|
154
|
-
data = self.parse_query_params(request.query_params)
|
155
155
|
else:
|
156
156
|
raise HTTPException(400, "Unsupported content type")
|
157
157
|
|
@@ -0,0 +1,274 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
|
3
|
+
from asyncio import ensure_future
|
4
|
+
from inspect import isawaitable
|
5
|
+
from typing import (
|
6
|
+
TYPE_CHECKING,
|
7
|
+
Awaitable,
|
8
|
+
Callable,
|
9
|
+
Iterable,
|
10
|
+
List,
|
11
|
+
Optional,
|
12
|
+
Sequence,
|
13
|
+
Tuple,
|
14
|
+
Type,
|
15
|
+
TypedDict,
|
16
|
+
Union,
|
17
|
+
cast,
|
18
|
+
)
|
19
|
+
|
20
|
+
from graphql import GraphQLError, parse
|
21
|
+
from graphql import execute as original_execute
|
22
|
+
from graphql.validation import validate
|
23
|
+
|
24
|
+
from strawberry.exceptions import MissingQueryError
|
25
|
+
from strawberry.extensions.runner import SchemaExtensionsRunner
|
26
|
+
from strawberry.types import ExecutionResult
|
27
|
+
|
28
|
+
from .exceptions import InvalidOperationTypeError
|
29
|
+
|
30
|
+
if TYPE_CHECKING:
|
31
|
+
from typing_extensions import NotRequired, Unpack
|
32
|
+
|
33
|
+
from graphql import ExecutionContext as GraphQLExecutionContext
|
34
|
+
from graphql import ExecutionResult as GraphQLExecutionResult
|
35
|
+
from graphql import GraphQLSchema
|
36
|
+
from graphql.language import DocumentNode
|
37
|
+
from graphql.validation import ASTValidationRule
|
38
|
+
|
39
|
+
from strawberry.extensions import SchemaExtension
|
40
|
+
from strawberry.types import ExecutionContext
|
41
|
+
from strawberry.types.graphql import OperationType
|
42
|
+
|
43
|
+
|
44
|
+
# duplicated because of https://github.com/mkdocstrings/griffe-typingdoc/issues/7
|
45
|
+
class ParseOptions(TypedDict):
|
46
|
+
max_tokens: NotRequired[int]
|
47
|
+
|
48
|
+
|
49
|
+
def parse_document(query: str, **kwargs: Unpack[ParseOptions]) -> DocumentNode:
|
50
|
+
return parse(query, **kwargs)
|
51
|
+
|
52
|
+
|
53
|
+
def validate_document(
|
54
|
+
schema: GraphQLSchema,
|
55
|
+
document: DocumentNode,
|
56
|
+
validation_rules: Tuple[Type[ASTValidationRule], ...],
|
57
|
+
) -> List[GraphQLError]:
|
58
|
+
return validate(
|
59
|
+
schema,
|
60
|
+
document,
|
61
|
+
validation_rules,
|
62
|
+
)
|
63
|
+
|
64
|
+
|
65
|
+
def _run_validation(execution_context: ExecutionContext) -> None:
|
66
|
+
# Check if there are any validation rules or if validation has
|
67
|
+
# already been run by an extension
|
68
|
+
if len(execution_context.validation_rules) > 0 and execution_context.errors is None:
|
69
|
+
assert execution_context.graphql_document
|
70
|
+
execution_context.errors = validate_document(
|
71
|
+
execution_context.schema._schema,
|
72
|
+
execution_context.graphql_document,
|
73
|
+
execution_context.validation_rules,
|
74
|
+
)
|
75
|
+
|
76
|
+
|
77
|
+
async def execute(
|
78
|
+
schema: GraphQLSchema,
|
79
|
+
*,
|
80
|
+
allowed_operation_types: Iterable[OperationType],
|
81
|
+
extensions: Sequence[Union[Type[SchemaExtension], SchemaExtension]],
|
82
|
+
execution_context: ExecutionContext,
|
83
|
+
execution_context_class: Optional[Type[GraphQLExecutionContext]] = None,
|
84
|
+
process_errors: Callable[[List[GraphQLError], Optional[ExecutionContext]], None],
|
85
|
+
) -> ExecutionResult:
|
86
|
+
extensions_runner = SchemaExtensionsRunner(
|
87
|
+
execution_context=execution_context,
|
88
|
+
extensions=list(extensions),
|
89
|
+
)
|
90
|
+
|
91
|
+
try:
|
92
|
+
async with extensions_runner.operation():
|
93
|
+
# Note: In graphql-core the schema would be validated here but in
|
94
|
+
# Strawberry we are validating it at initialisation time instead
|
95
|
+
if not execution_context.query:
|
96
|
+
raise MissingQueryError()
|
97
|
+
|
98
|
+
async with extensions_runner.parsing():
|
99
|
+
try:
|
100
|
+
if not execution_context.graphql_document:
|
101
|
+
execution_context.graphql_document = parse_document(
|
102
|
+
execution_context.query, **execution_context.parse_options
|
103
|
+
)
|
104
|
+
|
105
|
+
except GraphQLError as exc:
|
106
|
+
execution_context.errors = [exc]
|
107
|
+
process_errors([exc], execution_context)
|
108
|
+
return ExecutionResult(
|
109
|
+
data=None,
|
110
|
+
errors=[exc],
|
111
|
+
extensions=await extensions_runner.get_extensions_results(),
|
112
|
+
)
|
113
|
+
|
114
|
+
if execution_context.operation_type not in allowed_operation_types:
|
115
|
+
raise InvalidOperationTypeError(execution_context.operation_type)
|
116
|
+
|
117
|
+
async with extensions_runner.validation():
|
118
|
+
_run_validation(execution_context)
|
119
|
+
if execution_context.errors:
|
120
|
+
process_errors(execution_context.errors, execution_context)
|
121
|
+
return ExecutionResult(data=None, errors=execution_context.errors)
|
122
|
+
|
123
|
+
async with extensions_runner.executing():
|
124
|
+
if not execution_context.result:
|
125
|
+
result = original_execute(
|
126
|
+
schema,
|
127
|
+
execution_context.graphql_document,
|
128
|
+
root_value=execution_context.root_value,
|
129
|
+
middleware=extensions_runner.as_middleware_manager(),
|
130
|
+
variable_values=execution_context.variables,
|
131
|
+
operation_name=execution_context.operation_name,
|
132
|
+
context_value=execution_context.context,
|
133
|
+
execution_context_class=execution_context_class,
|
134
|
+
)
|
135
|
+
|
136
|
+
if isawaitable(result):
|
137
|
+
result = await cast(Awaitable["GraphQLExecutionResult"], result)
|
138
|
+
|
139
|
+
result = cast("GraphQLExecutionResult", result)
|
140
|
+
execution_context.result = result
|
141
|
+
# Also set errors on the execution_context so that it's easier
|
142
|
+
# to access in extensions
|
143
|
+
if result.errors:
|
144
|
+
execution_context.errors = result.errors
|
145
|
+
|
146
|
+
# Run the `Schema.process_errors` function here before
|
147
|
+
# extensions have a chance to modify them (see the MaskErrors
|
148
|
+
# extension). That way we can log the original errors but
|
149
|
+
# only return a sanitised version to the client.
|
150
|
+
process_errors(result.errors, execution_context)
|
151
|
+
|
152
|
+
except (MissingQueryError, InvalidOperationTypeError) as e:
|
153
|
+
raise e
|
154
|
+
except Exception as exc:
|
155
|
+
error = (
|
156
|
+
exc
|
157
|
+
if isinstance(exc, GraphQLError)
|
158
|
+
else GraphQLError(str(exc), original_error=exc)
|
159
|
+
)
|
160
|
+
execution_context.errors = [error]
|
161
|
+
process_errors([error], execution_context)
|
162
|
+
return ExecutionResult(
|
163
|
+
data=None,
|
164
|
+
errors=[error],
|
165
|
+
extensions=await extensions_runner.get_extensions_results(),
|
166
|
+
)
|
167
|
+
|
168
|
+
return ExecutionResult(
|
169
|
+
data=execution_context.result.data,
|
170
|
+
errors=execution_context.result.errors,
|
171
|
+
extensions=await extensions_runner.get_extensions_results(),
|
172
|
+
)
|
173
|
+
|
174
|
+
|
175
|
+
def execute_sync(
|
176
|
+
schema: GraphQLSchema,
|
177
|
+
*,
|
178
|
+
allowed_operation_types: Iterable[OperationType],
|
179
|
+
extensions: Sequence[Union[Type[SchemaExtension], SchemaExtension]],
|
180
|
+
execution_context: ExecutionContext,
|
181
|
+
execution_context_class: Optional[Type[GraphQLExecutionContext]] = None,
|
182
|
+
process_errors: Callable[[List[GraphQLError], Optional[ExecutionContext]], None],
|
183
|
+
) -> ExecutionResult:
|
184
|
+
extensions_runner = SchemaExtensionsRunner(
|
185
|
+
execution_context=execution_context,
|
186
|
+
extensions=list(extensions),
|
187
|
+
)
|
188
|
+
|
189
|
+
try:
|
190
|
+
with extensions_runner.operation():
|
191
|
+
# Note: In graphql-core the schema would be validated here but in
|
192
|
+
# Strawberry we are validating it at initialisation time instead
|
193
|
+
if not execution_context.query:
|
194
|
+
raise MissingQueryError()
|
195
|
+
|
196
|
+
with extensions_runner.parsing():
|
197
|
+
try:
|
198
|
+
if not execution_context.graphql_document:
|
199
|
+
execution_context.graphql_document = parse_document(
|
200
|
+
execution_context.query, **execution_context.parse_options
|
201
|
+
)
|
202
|
+
|
203
|
+
except GraphQLError as exc:
|
204
|
+
execution_context.errors = [exc]
|
205
|
+
process_errors([exc], execution_context)
|
206
|
+
return ExecutionResult(
|
207
|
+
data=None,
|
208
|
+
errors=[exc],
|
209
|
+
extensions=extensions_runner.get_extensions_results_sync(),
|
210
|
+
)
|
211
|
+
|
212
|
+
if execution_context.operation_type not in allowed_operation_types:
|
213
|
+
raise InvalidOperationTypeError(execution_context.operation_type)
|
214
|
+
|
215
|
+
with extensions_runner.validation():
|
216
|
+
_run_validation(execution_context)
|
217
|
+
if execution_context.errors:
|
218
|
+
process_errors(execution_context.errors, execution_context)
|
219
|
+
return ExecutionResult(data=None, errors=execution_context.errors)
|
220
|
+
|
221
|
+
with extensions_runner.executing():
|
222
|
+
if not execution_context.result:
|
223
|
+
result = original_execute(
|
224
|
+
schema,
|
225
|
+
execution_context.graphql_document,
|
226
|
+
root_value=execution_context.root_value,
|
227
|
+
middleware=extensions_runner.as_middleware_manager(),
|
228
|
+
variable_values=execution_context.variables,
|
229
|
+
operation_name=execution_context.operation_name,
|
230
|
+
context_value=execution_context.context,
|
231
|
+
execution_context_class=execution_context_class,
|
232
|
+
)
|
233
|
+
|
234
|
+
if isawaitable(result):
|
235
|
+
result = cast(Awaitable["GraphQLExecutionResult"], result)
|
236
|
+
ensure_future(result).cancel()
|
237
|
+
raise RuntimeError(
|
238
|
+
"GraphQL execution failed to complete synchronously."
|
239
|
+
)
|
240
|
+
|
241
|
+
result = cast("GraphQLExecutionResult", result)
|
242
|
+
execution_context.result = result
|
243
|
+
# Also set errors on the execution_context so that it's easier
|
244
|
+
# to access in extensions
|
245
|
+
if result.errors:
|
246
|
+
execution_context.errors = result.errors
|
247
|
+
|
248
|
+
# Run the `Schema.process_errors` function here before
|
249
|
+
# extensions have a chance to modify them (see the MaskErrors
|
250
|
+
# extension). That way we can log the original errors but
|
251
|
+
# only return a sanitised version to the client.
|
252
|
+
process_errors(result.errors, execution_context)
|
253
|
+
|
254
|
+
except (MissingQueryError, InvalidOperationTypeError) as e:
|
255
|
+
raise e
|
256
|
+
except Exception as exc:
|
257
|
+
error = (
|
258
|
+
exc
|
259
|
+
if isinstance(exc, GraphQLError)
|
260
|
+
else GraphQLError(str(exc), original_error=exc)
|
261
|
+
)
|
262
|
+
execution_context.errors = [error]
|
263
|
+
process_errors([error], execution_context)
|
264
|
+
return ExecutionResult(
|
265
|
+
data=None,
|
266
|
+
errors=[error],
|
267
|
+
extensions=extensions_runner.get_extensions_results_sync(),
|
268
|
+
)
|
269
|
+
|
270
|
+
return ExecutionResult(
|
271
|
+
data=execution_context.result.data,
|
272
|
+
errors=execution_context.result.errors,
|
273
|
+
extensions=extensions_runner.get_extensions_results_sync(),
|
274
|
+
)
|
@@ -1,263 +0,0 @@
|
|
1
|
-
from __future__ import annotations
|
2
|
-
|
3
|
-
from asyncio import ensure_future
|
4
|
-
from inspect import isawaitable
|
5
|
-
from typing import (
|
6
|
-
TYPE_CHECKING,
|
7
|
-
Awaitable,
|
8
|
-
Callable,
|
9
|
-
Iterable,
|
10
|
-
List,
|
11
|
-
Optional,
|
12
|
-
Sequence,
|
13
|
-
Tuple,
|
14
|
-
Type,
|
15
|
-
TypedDict,
|
16
|
-
Union,
|
17
|
-
cast,
|
18
|
-
)
|
19
|
-
|
20
|
-
from graphql import GraphQLError, parse
|
21
|
-
from graphql import execute as original_execute
|
22
|
-
from graphql.validation import validate
|
23
|
-
|
24
|
-
from strawberry.exceptions import MissingQueryError
|
25
|
-
from strawberry.extensions.runner import SchemaExtensionsRunner
|
26
|
-
from strawberry.types import ExecutionResult
|
27
|
-
|
28
|
-
from .exceptions import InvalidOperationTypeError
|
29
|
-
|
30
|
-
if TYPE_CHECKING:
|
31
|
-
from typing_extensions import NotRequired, Unpack
|
32
|
-
|
33
|
-
from graphql import ExecutionContext as GraphQLExecutionContext
|
34
|
-
from graphql import ExecutionResult as GraphQLExecutionResult
|
35
|
-
from graphql import GraphQLSchema
|
36
|
-
from graphql.language import DocumentNode
|
37
|
-
from graphql.validation import ASTValidationRule
|
38
|
-
|
39
|
-
from strawberry.extensions import SchemaExtension
|
40
|
-
from strawberry.types import ExecutionContext
|
41
|
-
from strawberry.types.graphql import OperationType
|
42
|
-
|
43
|
-
|
44
|
-
# duplicated because of https://github.com/mkdocstrings/griffe-typingdoc/issues/7
|
45
|
-
class ParseOptions(TypedDict):
|
46
|
-
max_tokens: NotRequired[int]
|
47
|
-
|
48
|
-
|
49
|
-
def parse_document(query: str, **kwargs: Unpack[ParseOptions]) -> DocumentNode:
|
50
|
-
return parse(query, **kwargs)
|
51
|
-
|
52
|
-
|
53
|
-
def validate_document(
|
54
|
-
schema: GraphQLSchema,
|
55
|
-
document: DocumentNode,
|
56
|
-
validation_rules: Tuple[Type[ASTValidationRule], ...],
|
57
|
-
) -> List[GraphQLError]:
|
58
|
-
return validate(
|
59
|
-
schema,
|
60
|
-
document,
|
61
|
-
validation_rules,
|
62
|
-
)
|
63
|
-
|
64
|
-
|
65
|
-
def _run_validation(execution_context: ExecutionContext) -> None:
|
66
|
-
# Check if there are any validation rules or if validation has
|
67
|
-
# already been run by an extension
|
68
|
-
if len(execution_context.validation_rules) > 0 and execution_context.errors is None:
|
69
|
-
assert execution_context.graphql_document
|
70
|
-
execution_context.errors = validate_document(
|
71
|
-
execution_context.schema._schema,
|
72
|
-
execution_context.graphql_document,
|
73
|
-
execution_context.validation_rules,
|
74
|
-
)
|
75
|
-
|
76
|
-
|
77
|
-
async def execute(
|
78
|
-
schema: GraphQLSchema,
|
79
|
-
*,
|
80
|
-
allowed_operation_types: Iterable[OperationType],
|
81
|
-
extensions: Sequence[Union[Type[SchemaExtension], SchemaExtension]],
|
82
|
-
execution_context: ExecutionContext,
|
83
|
-
execution_context_class: Optional[Type[GraphQLExecutionContext]] = None,
|
84
|
-
process_errors: Callable[[List[GraphQLError], Optional[ExecutionContext]], None],
|
85
|
-
) -> ExecutionResult:
|
86
|
-
extensions_runner = SchemaExtensionsRunner(
|
87
|
-
execution_context=execution_context,
|
88
|
-
extensions=list(extensions),
|
89
|
-
)
|
90
|
-
|
91
|
-
async with extensions_runner.operation():
|
92
|
-
# Note: In graphql-core the schema would be validated here but in
|
93
|
-
# Strawberry we are validating it at initialisation time instead
|
94
|
-
if not execution_context.query:
|
95
|
-
raise MissingQueryError()
|
96
|
-
|
97
|
-
async with extensions_runner.parsing():
|
98
|
-
try:
|
99
|
-
if not execution_context.graphql_document:
|
100
|
-
execution_context.graphql_document = parse_document(
|
101
|
-
execution_context.query, **execution_context.parse_options
|
102
|
-
)
|
103
|
-
|
104
|
-
except GraphQLError as error:
|
105
|
-
execution_context.errors = [error]
|
106
|
-
process_errors([error], execution_context)
|
107
|
-
return ExecutionResult(
|
108
|
-
data=None,
|
109
|
-
errors=[error],
|
110
|
-
extensions=await extensions_runner.get_extensions_results(),
|
111
|
-
)
|
112
|
-
|
113
|
-
except Exception as error: # pragma: no cover
|
114
|
-
error = GraphQLError(str(error), original_error=error)
|
115
|
-
|
116
|
-
execution_context.errors = [error]
|
117
|
-
process_errors([error], execution_context)
|
118
|
-
|
119
|
-
return ExecutionResult(
|
120
|
-
data=None,
|
121
|
-
errors=[error],
|
122
|
-
extensions=await extensions_runner.get_extensions_results(),
|
123
|
-
)
|
124
|
-
|
125
|
-
if execution_context.operation_type not in allowed_operation_types:
|
126
|
-
raise InvalidOperationTypeError(execution_context.operation_type)
|
127
|
-
|
128
|
-
async with extensions_runner.validation():
|
129
|
-
_run_validation(execution_context)
|
130
|
-
if execution_context.errors:
|
131
|
-
process_errors(execution_context.errors, execution_context)
|
132
|
-
return ExecutionResult(data=None, errors=execution_context.errors)
|
133
|
-
|
134
|
-
async with extensions_runner.executing():
|
135
|
-
if not execution_context.result:
|
136
|
-
result = original_execute(
|
137
|
-
schema,
|
138
|
-
execution_context.graphql_document,
|
139
|
-
root_value=execution_context.root_value,
|
140
|
-
middleware=extensions_runner.as_middleware_manager(),
|
141
|
-
variable_values=execution_context.variables,
|
142
|
-
operation_name=execution_context.operation_name,
|
143
|
-
context_value=execution_context.context,
|
144
|
-
execution_context_class=execution_context_class,
|
145
|
-
)
|
146
|
-
|
147
|
-
if isawaitable(result):
|
148
|
-
result = await cast(Awaitable["GraphQLExecutionResult"], result)
|
149
|
-
|
150
|
-
result = cast("GraphQLExecutionResult", result)
|
151
|
-
execution_context.result = result
|
152
|
-
# Also set errors on the execution_context so that it's easier
|
153
|
-
# to access in extensions
|
154
|
-
if result.errors:
|
155
|
-
execution_context.errors = result.errors
|
156
|
-
|
157
|
-
# Run the `Schema.process_errors` function here before
|
158
|
-
# extensions have a chance to modify them (see the MaskErrors
|
159
|
-
# extension). That way we can log the original errors but
|
160
|
-
# only return a sanitised version to the client.
|
161
|
-
process_errors(result.errors, execution_context)
|
162
|
-
|
163
|
-
return ExecutionResult(
|
164
|
-
data=execution_context.result.data,
|
165
|
-
errors=execution_context.result.errors,
|
166
|
-
extensions=await extensions_runner.get_extensions_results(),
|
167
|
-
)
|
168
|
-
|
169
|
-
|
170
|
-
def execute_sync(
|
171
|
-
schema: GraphQLSchema,
|
172
|
-
*,
|
173
|
-
allowed_operation_types: Iterable[OperationType],
|
174
|
-
extensions: Sequence[Union[Type[SchemaExtension], SchemaExtension]],
|
175
|
-
execution_context: ExecutionContext,
|
176
|
-
execution_context_class: Optional[Type[GraphQLExecutionContext]] = None,
|
177
|
-
process_errors: Callable[[List[GraphQLError], Optional[ExecutionContext]], None],
|
178
|
-
) -> ExecutionResult:
|
179
|
-
extensions_runner = SchemaExtensionsRunner(
|
180
|
-
execution_context=execution_context,
|
181
|
-
extensions=list(extensions),
|
182
|
-
)
|
183
|
-
|
184
|
-
with extensions_runner.operation():
|
185
|
-
# Note: In graphql-core the schema would be validated here but in
|
186
|
-
# Strawberry we are validating it at initialisation time instead
|
187
|
-
if not execution_context.query:
|
188
|
-
raise MissingQueryError()
|
189
|
-
|
190
|
-
with extensions_runner.parsing():
|
191
|
-
try:
|
192
|
-
if not execution_context.graphql_document:
|
193
|
-
execution_context.graphql_document = parse_document(
|
194
|
-
execution_context.query, **execution_context.parse_options
|
195
|
-
)
|
196
|
-
|
197
|
-
except GraphQLError as error:
|
198
|
-
execution_context.errors = [error]
|
199
|
-
process_errors([error], execution_context)
|
200
|
-
return ExecutionResult(
|
201
|
-
data=None,
|
202
|
-
errors=[error],
|
203
|
-
extensions=extensions_runner.get_extensions_results_sync(),
|
204
|
-
)
|
205
|
-
|
206
|
-
except Exception as error: # pragma: no cover
|
207
|
-
error = GraphQLError(str(error), original_error=error)
|
208
|
-
|
209
|
-
execution_context.errors = [error]
|
210
|
-
process_errors([error], execution_context)
|
211
|
-
return ExecutionResult(
|
212
|
-
data=None,
|
213
|
-
errors=[error],
|
214
|
-
extensions=extensions_runner.get_extensions_results_sync(),
|
215
|
-
)
|
216
|
-
|
217
|
-
if execution_context.operation_type not in allowed_operation_types:
|
218
|
-
raise InvalidOperationTypeError(execution_context.operation_type)
|
219
|
-
|
220
|
-
with extensions_runner.validation():
|
221
|
-
_run_validation(execution_context)
|
222
|
-
if execution_context.errors:
|
223
|
-
process_errors(execution_context.errors, execution_context)
|
224
|
-
return ExecutionResult(data=None, errors=execution_context.errors)
|
225
|
-
|
226
|
-
with extensions_runner.executing():
|
227
|
-
if not execution_context.result:
|
228
|
-
result = original_execute(
|
229
|
-
schema,
|
230
|
-
execution_context.graphql_document,
|
231
|
-
root_value=execution_context.root_value,
|
232
|
-
middleware=extensions_runner.as_middleware_manager(),
|
233
|
-
variable_values=execution_context.variables,
|
234
|
-
operation_name=execution_context.operation_name,
|
235
|
-
context_value=execution_context.context,
|
236
|
-
execution_context_class=execution_context_class,
|
237
|
-
)
|
238
|
-
|
239
|
-
if isawaitable(result):
|
240
|
-
result = cast(Awaitable["GraphQLExecutionResult"], result)
|
241
|
-
ensure_future(result).cancel()
|
242
|
-
raise RuntimeError(
|
243
|
-
"GraphQL execution failed to complete synchronously."
|
244
|
-
)
|
245
|
-
|
246
|
-
result = cast("GraphQLExecutionResult", result)
|
247
|
-
execution_context.result = result
|
248
|
-
# Also set errors on the execution_context so that it's easier
|
249
|
-
# to access in extensions
|
250
|
-
if result.errors:
|
251
|
-
execution_context.errors = result.errors
|
252
|
-
|
253
|
-
# Run the `Schema.process_errors` function here before
|
254
|
-
# extensions have a chance to modify them (see the MaskErrors
|
255
|
-
# extension). That way we can log the original errors but
|
256
|
-
# only return a sanitised version to the client.
|
257
|
-
process_errors(result.errors, execution_context)
|
258
|
-
|
259
|
-
return ExecutionResult(
|
260
|
-
data=execution_context.result.data,
|
261
|
-
errors=execution_context.result.errors,
|
262
|
-
extensions=extensions_runner.get_extensions_results_sync(),
|
263
|
-
)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/aiohttp/handlers/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/aiohttp/test/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/asgi/handlers/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{strawberry_graphql-0.225.0 → strawberry_graphql-0.226.1}/strawberry/channels/handlers/base.py
RENAMED
File without changes
|