I am making graphql api server with tinkerpop3 graph database (aws neptune)
for example, I want implementation of graphql below
{
post {
id
title,
comments {
id
}
}
}
and I make gremlin query like below
g.V().hasLabel('post').match(
__.id().as('id'),
__.values('title').as('title'),
__.union(
out('has_comment').match(
__.id().as('id')
).select('id')
).fold().as('comments')
).select('id', 'title', 'comments')
but this query isn't working correctly. because id
of comment is overlap with id
of post.
I want use .as('id')
locally in match statement.
is there any solution?