Search code examples
gremlingremlin-serveramazon-neptunegremlinjs

Could not locate method: DefaultGraphTraversal.addE() Gremlin


For some reason I'm getting the above error when I try to use addE in my traversal.

const traversal = await g
    .V(id)
    .fold()
    .coalesce(__.unfold(), __.addV().property(t.id, id))
    .inE()
    .where(__.outV().hasId(bob))
    .fold()
    .coalesce(__.unfold(), __.addE().from_(__.V(bob)).to(__.V(tweetId))
    .next()

Any idea to what's going wrong here? That error message makes no sense to me.

This is on a Neptune server.


Solution

  • You are not supplying an argument to addE(). There is no zero-argument option to that step. You must supply an edge label as an argument either by way of addE(String) or addE(Traversal). If you see that error in the future, it is best to check the javadoc for GraphTraversal or GraphTraversalSource when you see that.