Skip to content

Commit

Permalink
chore: recreate loader if old loader is on different loop (#395)
Browse files Browse the repository at this point in the history
* Recreate loader if old loader is on incorrect loop

* Lint

---------

Co-authored-by: Cadu <[email protected]>
  • Loading branch information
zeptonaut and flipbit03 committed Oct 9, 2023
1 parent 1436807 commit b94230e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 1 addition & 3 deletions graphene_sqlalchemy/batching.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@ def _get_loader(relationship_prop):
RELATIONSHIP_LOADERS_CACHE[relationship_prop] = loader
return loader

loader = _get_loader(relationship_prop)

async def resolve(root, info, **args):
return await loader.load(root)
return await _get_loader(relationship_prop).load(root)

return resolve
1 change: 0 additions & 1 deletion graphene_sqlalchemy/tests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
from graphene_sqlalchemy.utils import SQL_VERSION_HIGHER_EQUAL_THAN_1_4, SQL_VERSION_HIGHER_EQUAL_THAN_2

# fmt: off
import sqlalchemy
if SQL_VERSION_HIGHER_EQUAL_THAN_2:
from sqlalchemy.sql.sqltypes import HasExpressionLookup # noqa # isort:skip
else:
Expand Down

0 comments on commit b94230e

Please sign in to comment.