【发布时间】:2022-06-14 22:33:25
【问题描述】:
我有一个看起来像这样的架构。
exports.typeDefs = gql`
type User {
userid: ID!
name: String
}
type Post {
post_id: ID!
post_category: String!
post_type: String!
post_hashtag: String
user: User
}
type query {
post_hashtag: String
@cypher[statement: "MATCH (n:Test_Temp) RETURN n.post_hashtag"]
}
`;
现在帖子有名为“post_hashtag”的字段。 我想定义另一种模式类型并获取所有节点的 post_hashtag 属性 帖子。
示例:如果我查询
query{
hashtag{
post_hashtag
}
}
这应该给出任何帖子节点中可用的所有主题标签。
这几天我一直在尝试。经历了不同的解决方案,但都没有奏效。
【问题讨论】: