【发布时间】:2018-01-24 06:16:59
【问题描述】:
我正在使用 tinkerpop3 图形数据库 (aws neptune) 制作 graphql api 服务器
例如,我想在下面实现graphql
{
post {
id
title,
comments {
id
}
}
}
然后我像下面这样进行 gremlin 查询
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')
但此查询无法正常工作。因为评论的id 与帖子的id 重叠。
我想在匹配语句中本地使用.as('id')。
有什么解决办法吗?
【问题讨论】:
-
相关:Understanding Scopes in Gremlin 来自官方 TinkerPop/Gremlin 用户邮件列表
-
另外,Netflix 对 GraphQL 到 Gremlin 的映射进行了实验:github.com/jkschneider/graphql-gremlin
标签: graphql gremlin local-variables tinkerpop3 amazon-neptune