Add YAML support for GraphFactory.