graphql-python / graphene-sqlalchemy

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

Batching dependent on Relay #325

Closed carolineclancy0 closed 1 year ago

carolineclancy0 commented 2 years ago

Hi!

We have been experiencing latency with large queries and found that we have several queries that have the N+1 problem. We added batching = True to our SQLAlchemyObjectType meta classes, but have not seen a decrease in the number of DB requests.

Is the batching field reliant on relay to work? I see in all of the batching tests interfaces = (relay.Node,) is also included in the Meta class.

Thank you!!!

erikwrede commented 2 years ago

I would suggest trying out this library, if your SQLAlchemy schema allows for it. It covers more cases than the SQLAlchemy implementation: https://github.com/operator/sqlalchemy_bulk_lazy_loader Are you using Graphene-Sqlalchemy 2 or 3?

As of right now, Batching is dependent on ConnectionFields, thus making it relay-dependent.

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.