strawberry-django-plus icon indicating copy to clipboard operation
strawberry-django-plus copied to clipboard

create and update mutations don't execute full_clean on Foreign Keys

Open robertmusil opened this issue 1 year ago • 0 comments

Given a model:

@gql.django.input(Address)
class AddressType:
    line1: str
    line2: str

@gql.django.input(User)
class UserType:
    first_name: gql.auto
    last_name: gql.auto
    address: Optional[AddressType]

Current behavior: Executing create (or update) mutation does not run Address.full_clean()

Expected behavior: Executing create (or update) mutation does run Address.full_clean() and collects all errors from User and Address, errors from Address are either nested or the field value uses dot notation (i.e. address.line1)

Affecting code: Result of this line

robertmusil avatar Aug 30 '22 10:08 robertmusil