Serialize graph directly instead of wrapping in an array