Closed
Description
Currently using SQL enums works well, unless you use a enum.Enum
as base for the enum. For example using this model:
class Hairkind(enum.Enum):
LONG = 'long'
SHORT = 'short'
class Pet(Base):
__tablename__ = 'pets'
id = Column(Integer(), primary_key=True)
hair_kind = Column(Enum(Hairkind, name='hair_kind'), nullable=False)
will fail badly if you try to query the hairKind field:
File "lib/python3.7/site-packages/graphql/execution/executor.py", line 622, in complete_leaf_value
path=path,
graphql.error.base.GraphQLError: Expected a value of type "hair_kind" but received: Hairkind.LONG
Metadata
Metadata
Assignees
Labels
No labels