Fix up the base classes for mutations.
Review Request #9538 — Created Feb. 1, 2018 and submitted — Latest diff uploaded
The class hierarchy for mutations was a mess. We had a few base classes
(BaseMutation,MonoBaseMutation, andMutateModelField), with a
hierarchy descending in that order.BaseMutationwas the base class
for all mutations.MonoBaseMutationwas for models.MutateModelField
was for fields on models. While the naming was inconsistent, that
hierarchy made sense.There were a few problems, though.
MutateModelField.mutate(the base
mutatefunction for models) really belonged inMonoBaseMutation, and
the lack of this made things pretty confusing. Worse, several of the
mutations that worked on models (and not fields) were inheriting from
MutateModelField.This change renames the base classes to
BaseMutation,
BaseModelMutation, andBaseModelFieldMutation, and fixes up the
order they're listed in the field and moving
BaseModelFieldMutation.mutateintoBaseModelMutation. It also fixes
up the specific mutations so that they all inherit from the correct
base class.
Unit tests pass.