Skip to content

Commit 94f1f59

Browse files
committed
Bugfix
- use graphene_type to access serializer
1 parent 0b7d678 commit 94f1f59

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

graphene_sqlalchemy/types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,11 +607,11 @@ async def get_result() -> Any:
607607
return None
608608

609609
def resolve_id(self, info):
610-
# graphene_type = info.parent_type.graphene_type
610+
graphene_type = info.parent_type.graphene_type
611611
keys = self.__mapper__.primary_key_from_instance(self)
612612

613613
try:
614-
return self.serializer.serialize(keys if len(keys) > 1 else keys[0])
614+
return graphene_type.serializer.serialize(keys)
615615

616616
except Exception as e:
617617
raise ValueError(f"Non-serializable primary key: {e}") from e

0 commit comments

Comments
 (0)