mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-04-25 11:23:45 +03:00
Rename serializer method
This commit is contained in:
parent
412747d632
commit
bc7d96b2be
|
@ -36,7 +36,7 @@ method as such:
|
||||||
class MySecondAwesomeMutation(SerializerMutation):
|
class MySecondAwesomeMutation(SerializerMutation):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def instantiate_serializer(cls, instance, args, request, info):
|
def get_serializer(cls, instance, args, request, info):
|
||||||
|
|
||||||
input = args.get('input')
|
input = args.get('input')
|
||||||
|
|
||||||
|
|
|
@ -105,19 +105,16 @@ class SerializerMutation(six.with_metaclass(SerializerMutationMeta, Mutation)):
|
||||||
description='May contain more than one error for '
|
description='May contain more than one error for '
|
||||||
'same field.'
|
'same field.'
|
||||||
)
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def instantiate_serializer(cls, instance, args, request, info):
|
def get_serializer(cls, instance, args, request, info):
|
||||||
|
|
||||||
input = args.get('input')
|
input = args.get('input')
|
||||||
|
|
||||||
return cls._meta.serializer_class(data=dict(input))
|
return cls._meta.serializer_class(data=dict(input))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def mutate(cls, instance, args, request, info):
|
def mutate(cls, instance, args, request, info):
|
||||||
|
serializer = cls.get_serializer(instance, args, request, info)
|
||||||
serializer = cls.instantiate_serializer(instance, args, request, info)
|
|
||||||
|
|
||||||
if serializer.is_valid():
|
if serializer.is_valid():
|
||||||
return cls.perform_mutate(serializer, info)
|
return cls.perform_mutate(serializer, info)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user