Latest Results
Address code review of exception handlers
Fixes the issues found in the pre-merge review of the exception-handlers
feature (mapping Python exceptions to typed GraphQL union results).
Correctness:
- Return an awaitable handled result on async fields so async field
extensions (e.g. async PermissionExtension) can await it instead of
crashing with "object ... can't be used in 'await' expression".
- Make the argument-conversion-error path safe for arg-consuming
extensions: field extensions (e.g. permission checks) run with the raw
argument values, so a matching handler can convert the error instead of
it surfacing as an unrelated crash.
- Match a concrete generic error_type (e.g. Error[int]) against the
matching union member by resolving it through StrawberryAnnotation,
instead of silently collapsing to the bare generic and never matching.
- Route basic fields (no resolver) through handling when a handler
applies, so an unrelated extension no longer flips whether errors are
converted.
- Skip all exception-handling machinery when no handler applies to a
field (fast path), so existing schemas keep the resolver's original
Task/Future and pay no overhead.
API surface:
- Move federation Schema's exception_handlers after federation_version
so a positional version argument can't land in it.
- Make strawberry.ExceptionHandler a @runtime_checkable Protocol.
- Declare exception_handlers on the BaseSchema protocol.
- Rename the internal excepthook alias to ExcepthookHandler and the new
type_comparison helper to _resolve_object_definition to avoid
colliding with public names.
Cleanup:
- Pre-compute applicable handlers per field once at schema build,
removing per-request rescans and the double handler scan.
- Convert arguments once, guarded by a single try/except, instead of
branching on whether the field has handlers.
- Rely on type hints for handler configuration rather than validating it
at runtime, matching the rest of the codebase.
Also adds regression tests and benchmarks, documents that generic error
types must be referenced by their concrete instantiation, and notes that
subscriptions are not covered.2026-06-28-add-generic-exception-handlers Address code review of exception handlers
Fixes the issues found in the pre-merge review of the exception-handlers
feature (mapping Python exceptions to typed GraphQL union results).
Correctness:
- Return an awaitable handled result on async fields so async field
extensions (e.g. async PermissionExtension) can await it instead of
crashing with "object ... can't be used in 'await' expression".
- Make the argument-conversion-error path safe for arg-consuming
extensions: field extensions (e.g. permission checks) run with the raw
argument values, so a matching handler can convert the error instead of
it surfacing as an unrelated crash.
- Match a concrete generic error_type (e.g. Error[int]) against the
matching union member by resolving it through StrawberryAnnotation,
instead of silently collapsing to the bare generic and never matching.
- Route basic fields (no resolver) through handling when a handler
applies, so an unrelated extension no longer flips whether errors are
converted.
- Skip all exception-handling machinery when no handler applies to a
field (fast path), so existing schemas keep the resolver's original
Task/Future and pay no overhead.
API surface:
- Move federation Schema's exception_handlers after federation_version
so a positional version argument can't land in it.
- Make strawberry.ExceptionHandler a @runtime_checkable Protocol.
- Declare exception_handlers on the BaseSchema protocol.
- Rename the internal excepthook alias to ExcepthookHandler and the new
type_comparison helper to _resolve_object_definition to avoid
colliding with public names.
Cleanup:
- Pre-compute applicable handlers per field once at schema build,
removing per-request rescans and the double handler scan.
- Convert arguments once, guarded by a single try/except, instead of
branching on whether the field has handlers.
- Rely on type hints for handler configuration rather than validating it
at runtime, matching the rest of the codebase.
Also adds regression tests and benchmarks, documents that generic error
types must be referenced by their concrete instantiation, and notes that
subscriptions are not covered.2026-06-28-add-generic-exception-handlers Address code review of exception handlers
Fixes the issues found in the pre-merge review of the exception-handlers
feature (mapping Python exceptions to typed GraphQL union results).
Correctness:
- Return an awaitable handled result on async fields so async field
extensions (e.g. async PermissionExtension) can await it instead of
crashing with "object ... can't be used in 'await' expression".
- Make the argument-conversion-error path safe for arg-consuming
extensions: field extensions (e.g. permission checks) run with the raw
argument values, so a matching handler can convert the error instead of
it surfacing as an unrelated crash.
- Match a concrete generic error_type (e.g. Error[int]) against the
matching union member by resolving it through StrawberryAnnotation,
instead of silently collapsing to the bare generic and never matching.
- Route basic fields (no resolver) through handling when a handler
applies, so an unrelated extension no longer flips whether errors are
converted.
- Skip all exception-handling machinery when no handler applies to a
field (fast path), so existing schemas keep the resolver's original
Task/Future and pay no overhead.
API surface:
- Move federation Schema's exception_handlers after federation_version
so a positional version argument can't land in it.
- Make strawberry.ExceptionHandler a @runtime_checkable Protocol.
- Declare exception_handlers on the BaseSchema protocol.
- Rename the internal excepthook alias to ExcepthookHandler and the new
type_comparison helper to _resolve_object_definition to avoid
colliding with public names.
Cleanup:
- Pre-compute applicable handlers per field once at schema build,
removing per-request rescans and the double handler scan.
- Convert arguments once, guarded by a single try/except, instead of
branching on whether the field has handlers.
- Rely on type hints for handler configuration rather than validating it
at runtime, matching the rest of the codebase.
Also adds regression tests and benchmarks, documents that generic error
types must be referenced by their concrete instantiation, and notes that
subscriptions are not covered.2026-06-28-add-generic-exception-handlers Address code review of exception handlers
Fixes the issues found in the pre-merge review of the exception-handlers
feature (mapping Python exceptions to typed GraphQL union results).
Correctness:
- Return an awaitable handled result on async fields so async field
extensions (e.g. async PermissionExtension) can await it instead of
crashing with "object ... can't be used in 'await' expression".
- Make the argument-conversion-error path safe for arg-consuming
extensions: field extensions (e.g. permission checks) run with the raw
argument values, so a matching handler can convert the error instead of
it surfacing as an unrelated crash.
- Match a concrete generic error_type (e.g. Error[int]) against the
matching union member by resolving it through StrawberryAnnotation,
instead of silently collapsing to the bare generic and never matching.
- Route basic fields (no resolver) through handling when a handler
applies, so an unrelated extension no longer flips whether errors are
converted.
- Skip all exception-handling machinery when no handler applies to a
field (fast path), so existing schemas keep the resolver's original
Task/Future and pay no overhead.
API surface:
- Move federation Schema's exception_handlers after federation_version
so a positional version argument can't land in it.
- Make strawberry.ExceptionHandler a @runtime_checkable Protocol.
- Declare exception_handlers on the BaseSchema protocol.
- Rename the internal excepthook alias to ExcepthookHandler and the new
type_comparison helper to _resolve_object_definition to avoid
colliding with public names.
Cleanup:
- Pre-compute applicable handlers per field once at schema build,
removing per-request rescans and the double handler scan.
- Convert arguments once, guarded by a single try/except, instead of
branching on whether the field has handlers.
- Rely on type hints for handler configuration rather than validating it
at runtime, matching the rest of the codebase.
Also adds regression tests and benchmarks, documents that generic error
types must be referenced by their concrete instantiation, and notes that
subscriptions are not covered.2026-06-28-add-generic-exception-handlers Latest Branches
0%
2026-06-28-add-generic-exception-handlers 0%
codex/require-release-link-social-copy 0%
DoctorJohn:sync-graphql-over-http-spec-tests © 2026 CodSpeed Technology