graphql-python / graphene-sqlalchemy

Graphene SQLAlchemy integration
http://docs.graphene-python.org/projects/sqlalchemy/en/latest/
MIT License
980 stars 227 forks source link

How to use graphene-sqlalchemy with Dataloader? #106

Closed balthild closed 6 years ago

balthild commented 6 years ago

Should I define custom resolvers calling xxx_loader.load(...) in the class which extends SQLAlchemyObjectType? If so, what data I should return in DataLoader's batch_load_fn()? SQLAlchemy model objects or graphene.ObjectType objects?

kigen commented 6 years ago

@balthild Were you able to figure this out. I am looking at implementing Dataloaders to improve my query performance. Kindly share if you ever did.

balthild commented 6 years ago

@kigen It's more concerning the design of Python language. Python is duck-typing, so I could return an object for Any class, as long as the object contains those required attributes.

BTW, I'm not using graphene-sqlalchemy anymore. I've switched to MongoDB. :lol

github-actions[bot] commented 1 year ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related topics referencing this issue.