graphql-python / graphql-python/graphene-sqlalchemy

Enum ChoiceType column results in error

Open
#196 6 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Python
Stars
985
Forks
223
PR merge metrics
No merged PRs in 30d

Description

Howdy folks!

The following code produces `TypeError: 'MyEnum' object is not iterable`, but should work. Note that this is also involves package `sqlalchemy_utils`

```py
from enum import Enum

class MyEnum(Enum):
foo = 1
bar = 2

class MyModel(Base):
id = Column(sa.Integer, primary_key=True)
name = Column(sa.Unicode(255))
type = Column(ChoiceType(MyEnum, impl=Integer()))

class MyObject(SQLAlchemyObjectType):
class Meta:
model = MyModel
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.