How to serialize the `.graph()` data?

see