I'm building a system for composable traversals in my app and have a case where the none() step would be helpful. I need to explicitly return no traversal. It does not seem to be implemented in Gremlin javascript.
"errorType": "TypeError", "errorMessage": "o.none is not a function"
Is there a reason this has been omitted? Should it not be used? I'm working around it by using hasId("x")
which should never exist and thus return no traversal, but it's a hack.
g.V().choose(
hasCommentingUnlocked({
traversal: hasAccessToPrivateUserData({
traversal: __,
isAdmin,
userId,
grantedTraversal: __.identity(),
declinedTraversal: __.hasId("x"), // __.none() would be helpful here
}),
P,
}),
__.constant(true),
__.constant(false)
)