Skip to content

Commit b94230e

Browse files
zeptonautflipbit03
andauthored
chore: recreate loader if old loader is on different loop (#395)
* Recreate loader if old loader is on incorrect loop * Lint --------- Co-authored-by: Cadu <[email protected]>
1 parent 1436807 commit b94230e

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

Diff for: graphene_sqlalchemy/batching.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,7 @@ def _get_loader(relationship_prop):
137137
RELATIONSHIP_LOADERS_CACHE[relationship_prop] = loader
138138
return loader
139139

140-
loader = _get_loader(relationship_prop)
141-
142140
async def resolve(root, info, **args):
143-
return await loader.load(root)
141+
return await _get_loader(relationship_prop).load(root)
144142

145143
return resolve

Diff for: graphene_sqlalchemy/tests/models.py

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
from graphene_sqlalchemy.utils import SQL_VERSION_HIGHER_EQUAL_THAN_1_4, SQL_VERSION_HIGHER_EQUAL_THAN_2
2828

2929
# fmt: off
30-
import sqlalchemy
3130
if SQL_VERSION_HIGHER_EQUAL_THAN_2:
3231
from sqlalchemy.sql.sqltypes import HasExpressionLookup # noqa # isort:skip
3332
else:

0 commit comments

Comments
 (0)