Skip to content

Commit ecbde0f

Browse files
Fixed Loader
1 parent 3cdde12 commit ecbde0f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/strawberry_sqlalchemy_mapper/loader.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ async def load_fn(keys: List[Tuple]) -> List[Any]:
3939
def group_by_remote_key(row: Any) -> Tuple:
4040
return tuple(
4141
[
42-
getattr(row, remote.key)
42+
[
43+
getattr(row, k)
44+
for k, column in row.__mapper__.c.items()
45+
if remote.key == column.key
46+
][0]
4347
for _, remote in relationship.local_remote_pairs
4448
]
4549
)

0 commit comments

Comments
 (0)