-
Notifications
You must be signed in to change notification settings - Fork 820
Closed
Description
I recently upgraded from graphene 1.4.1 to 2.0.1, and after the upgrade all mutations are now ignoring required=True
. It looks like this is because only name
, description
, and deprecation_reason
are passed through to Field
(https://github.com/graphql-python/graphene/blob/master/graphene/types/mutation.py#L80). Is this intentional behavior? If so, what's the workaround?
In the meantime I created the following base Mutation class to fix this issue, but it's hacky and I would love to not need this:
class Mutation(graphene.Mutation):
@classmethod
def Field(cls, **kwargs):
return graphene.Field(
cls._meta.output,
args=cls._meta.arguments,
resolver=cls._meta.resolver,
**kwargs,
)
@staticmethod
def mutate(*_, **__):
raise NotImplementedError('Overwrite me!')
leethree, fangyuan, Fity and couldhll
Metadata
Metadata
Assignees
Labels
No labels