I want to move the points of a graphic created with the Sketch Widget programatically. Unfortunately I am seeing that when I change the geometry of a graphic via code, the graphic is not visible. I am wondering if there is a general approach toward manually editing locations of vertices in a graphics layer or if moving it via the map is the only way.
Here's a snippet of code showing my approach. Here is a Codepen for reproducing the problem: https://codepen.io/coxfsi/pen/mdpZbrG
if (graphicsLayer.graphics.length > 0){
let lineGraphic= graphicsLayer.graphics.getItemAt(0);
// Can't edit the geometry directly due to iterable error
// lineGraphic.geometry.paths[0][0] = 1000000;
// editing a point belonging to a clone does not throw error, but the line is invisible
let copyGraphic = lineGraphic.clone();
viewModel.layer.removeAll();
copyGraphic.geometry.paths[0][0] = 11311599;
viewModel.layer.add(copyGraphic);
viewModel.update(copyGraphic);
}