diff --git a/account/types.py b/account/types.py index 9af3b37..b990978 100644 --- a/account/types.py +++ b/account/types.py @@ -1,5 +1,6 @@ from contextlib import suppress +from mongoengine.base.datastructures import BaseDict import graphene from graphene.relay import Node from graphene_mongo import MongoengineObjectType @@ -45,7 +46,10 @@ class Meta: interfaces = (Node,) def resolve_meta(self, info): - return self.json_metadata or {} + if isinstance(self.json_metadata, BaseDict): + return self.json_metadata + else: + return {} class AccountAuthority(MongoengineObjectType):