throw TypeError on invalid edge _from or _to vertices [ci skip]