diff --git a/graphene/types/mutation.py b/graphene/types/mutation.py index ca87775ab..5f42e35f6 100644 --- a/graphene/types/mutation.py +++ b/graphene/types/mutation.py @@ -106,9 +106,7 @@ def __init_subclass_with_meta__( else: arguments = {} if not resolver: - mutate = getattr(cls, "mutate", None) - assert mutate, "All mutations must define a mutate method in it" - resolver = get_unbound_function(mutate) + resolver = get_unbound_function(cls.mutate) if _meta.fields: _meta.fields.update(fields) else: @@ -119,6 +117,10 @@ def __init_subclass_with_meta__( _meta.arguments = arguments 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 def Field(