mirror of
https://github.com/graphql-python/graphene.git
synced 2025-06-19 13:03:11 +03:00
Merge a97d3d3321
into 8290326308
This commit is contained in:
commit
560ffb71f2
|
@ -104,9 +104,7 @@ class Mutation(ObjectType):
|
||||||
)
|
)
|
||||||
arguments = props(input_class) if input_class else {}
|
arguments = props(input_class) if input_class else {}
|
||||||
if not resolver:
|
if not resolver:
|
||||||
mutate = getattr(cls, "mutate", None)
|
resolver = get_unbound_function(cls.mutate)
|
||||||
assert mutate, "All mutations must define a mutate method in it"
|
|
||||||
resolver = get_unbound_function(mutate)
|
|
||||||
if _meta.fields:
|
if _meta.fields:
|
||||||
_meta.fields.update(fields)
|
_meta.fields.update(fields)
|
||||||
else:
|
else:
|
||||||
|
@ -118,6 +116,10 @@ class Mutation(ObjectType):
|
||||||
|
|
||||||
super(Mutation, cls).__init_subclass_with_meta__(_meta=_meta, **options)
|
super(Mutation, cls).__init_subclass_with_meta__(_meta=_meta, **options)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def mutate(cls, parent, info, **kwargs):
|
||||||
|
raise NotImplementedError("All mutations must define a mutate method in it")
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def Field(
|
def Field(
|
||||||
cls, name=None, description=None, deprecation_reason=None, required=False
|
cls, name=None, description=None, deprecation_reason=None, required=False
|
||||||
|
|
Loading…
Reference in New Issue
Block a user