graphql-python / graphql-python/graphene-sqlalchemy
object of type 'SQLAlchemyConnectionField' has no len()
- Lingua principale
- Python
- Stelle
- 985
- Fork
- 223
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Hello,
I am implementing a connection field.
The excerpts from the code are:
```
# Classes:
class Common(graphene_sqlalchemy.SQLAlchemyObjectType):
class Meta:
abstract = True
...
class MyGraphQLModel(Common):
class Meta:
model = MyModel
interfaces = (graphene.relay.Node, )
# Fields:
mymodels = graphene.List(MyGraphQLModel)
def mymodels(p,i):
query = MyGraphQLModel.get_query(i)
return query.all()
connection_mymodels = graphene_sqlalchemy.SQLAlchemyConnectionField(MyGraphQLModel)
```
The first field (`mymodels`) which is an array without a connection works fine.
The second field which is a connection gives error:
```
"message": "object of type 'SQLAlchemyConnectionField' has no len()",
```
Any ideas? Thanks.
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.