Repository navigation
This release fixes fields that lose the permission classes and extensions of the
inherited field they override.
A field declared with strawberry.field(), or with a resolver, that overrides
an inherited field now keeps its permission classes and extensions, unless it
passes its own. Before, an override that only changed the description,
directives or resolver of a guarded field made it readable by anyone, without
any error:
@strawberry.interface
class Account:
email: str = strawberry.field(permission_classes=[IsStaff])
@strawberry.type
class Company(Account):
# was readable by anyone, now only by staff
email: str = strawberry.field(description="Billing email")Fields that should be readable without them now need permission_classes=[] or
extensions=[]. Overrides that change the resolver of a field with its own
extensions raise GuardedFieldOverrideError until they pass extensions.
Plain annotations overriding a guarded field now raise
GuardedFieldOverrideError on strawberry.pydantic types too, and a type
inheriting a field from parents, or merge_types types, that guard it
differently raises ConflictingInheritedFieldsError. That error is no longer
raised for parents that only differ in other options, like their resolver, and
input types are no longer checked.
See the
breaking changes for
the details.
This release was contributed by @patrick91 in #4840
Additional contributors: @ampagent