I can't create an edge in aws neptune using gremlin. I can create vertices. but not edge.

import { driver, process as gremlinProcess, structure } from "gremlin";

async function checkOut() {
const DriverRemoteConnection = driver.DriverRemoteConnection;
const Graph = structure.Graph;

const dc = new DriverRemoteConnection(ws://localhost:7070/gremlin, {
sloppy: true,
rejectUnauthorized: false,
});
const traversal = gremlinProcess.AnonymousTraversalSource.traversal();
const _ = gremlinProcess.traversal();
const graph = new Graph();
const g = graph.traversal().withRemote(dc);
const v1 = await g.addV("person").property("name", "main").next();
const v2 = await g.addV("person").property("name", "male").next();
const data = await g.addE("wrote").from
(g.V(v1.value.id)).to(g.V(11)).next();
g.V()
.toList()
.then((data) => {
console.log("DATA", data);
dc.close();
})
.catch((error) => {
console.log("ERROR", error);
dc.close();
});
}

checkOut();
Solution
Overview of differences between the Neptune and TinkerPop implementations of Gremlin.
Was this page helpful?