graphql-python / graphql-python/graphene-sqlalchemy
Enum ChoiceType column results in error
- Linguagem predominante
- Python
- Estrelas
- 985
- Forks
- 223
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
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
```
Guia de contribuição
Direção de pesquisa
Start by running the supplied MyEnum, ChoiceType, and SQLAlchemyObjectType reproduction to confirm the TypeError. Trace how the SQLAlchemy integration handles the ChoiceType column, then verify that generating the object type succeeds without the enum iteration error.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- graphql, python, sqlalchemy
- Domínio
- api, database
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 35/100