Search code examples
memgraphdb

How to serialize GQLAlchemy model objects to JSON?


I want to serialize objects from Python objects to JSON properties. I'm using GQLAlchemy and Memgraph. So the question is, how can I serialize GQLAlchemy model objects to JSON?


Solution

  • Since the model objects are pydantic objects, it should be quite easy by just calling object.dict().