Migrate https://github.com/clue/graph/pull/106 (refs https://github.com/clue/graph/issues/119)