获取所有相关帖子,除了使用ReactJ中使用wpgraphql的当前帖子以外
我正在尝试抓住相关的帖子,除非使用 wpgraphql 当前文章。我的想法是排除当前帖子的 id ,并在该类别中显示所有相关的博客文章。
我是 GraphQl 的新手,我不知道该如何解决它。这在GraphQL中可以吗?请帮忙
query MyQuery {
category(idType: DATABASE_ID, id: 1) {
posts {
edges {
node {
id
title
}
}
}
}
}
I'm trying to grab the related posts except the current post using WPGraphQL. My thought is to exclude the ID of the current post and display all related blog posts within the category.
I'm new to GraphQL, I don't know how to figure out to solve it. is this possible in GraphQL? Please help
query MyQuery {
category(idType: DATABASE_ID, id: 1) {
posts {
edges {
node {
id
title
}
}
}
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在
posts
类别下的连接字段上使用where.notin
参数。Use the
where.notIn
argument on theposts
connection field undercategory
, like so.