graphene-django
graphene-django copied to clipboard
Wrong error message for nested serializer in mutation
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"] }
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I am exactly facing the same issue, is there any solution to overcome the above problem
@ulgens Can I create a PR
which can solve the nested error issue in serializer mutation