Im currently having hard time on mutation enum Argument
.
Below are my code for Mutation
:
class CreatePerson(graphene.Mutation):
foo = graphene.String()
def mutate(self, info, **kwargs):
return CreatePerson(foo='foo')
class Arguments:
enum_arg = graphene.Argument(graphene.Enum.from_enum(EnumArg))
Enum class:
from enum import Enum
class EnumArg(Enum):
Baz = 0
Bar = 1
Spam = 2
Egg = 3
Command using POSTMAN:
{
"query": "mutation": {createPerson(enumArg=1) { foo }}
}
But I end up this error message:
"message": "Argument \"enumArg\" has invalid value 1.
Expected type \"EnumArg\", found 1.",
I also tried giving enumArg=\"Bar\"
on the createPerson
mutation and the error still persists.