graphql-python / graphql-python/graphene-django
Wrong error message for nested serializer in mutation
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 760
- PR merge metrics
- No merged PRs in 30d
Description
I have serializer mutation
```
class EmployeeSaveMutation(SerializerMutation):
class Meta:
serializer_class = EmployeeSerializer
class EmployeeSerializer(serializers.ModelSerializer):
user = UserSerializer()
class Meta:
model = Employee
fields = '__all__'
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = '__all__'
def validate(self, attrs):
raise serilizers.ValidationError('raise UserSerializer validate')
```
The response is:
```
erorrs = [
{ field: "user", messages: ["non_field_errors"] }
]
```
I need response something like:
```
{ field: "user.non_field_errors", messages: ["raise UserSerializer validate"] }
```
Contributor guide
Assessment
This issue has not been assessed yet.