mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-06-28 01:13:10 +03:00
add raise exception on serializer validation
This commit is contained in:
parent
8d95596ffb
commit
86f7f7a51b
|
@ -124,7 +124,7 @@ class SerializerMutation(ClientIDMutation):
|
||||||
kwargs = cls.get_serializer_kwargs(root, info, **input)
|
kwargs = cls.get_serializer_kwargs(root, info, **input)
|
||||||
serializer = cls._meta.serializer_class(**kwargs)
|
serializer = cls._meta.serializer_class(**kwargs)
|
||||||
|
|
||||||
if serializer.is_valid():
|
if serializer.is_valid(raise_exception=True):
|
||||||
return cls.perform_mutate(serializer, info)
|
return cls.perform_mutate(serializer, info)
|
||||||
else:
|
else:
|
||||||
errors = ErrorType.from_errors(serializer.errors)
|
errors = ErrorType.from_errors(serializer.errors)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user