我已经创建了一个自定义职位类型(jobPosts)<我正在使用Gatsby/Graphql/Apollo查询和修改数据。
Problem: 我需要从Wordpress中为特定用户获取职位。
我想按“author”查询JobPost,但Graphiql界面没有给我使用“where”和“author”的选项(在方案中不存在吗?):
所需查询:`{
query getJobs($userId: Int!) {
jobPosts (where: {author: $userId}) {
edges {
node {
id
databaseId
jobPostFields {
title
sector
}
}
}
}
}
}`
是否有人知道如何将此功能添加到架构/将“author”添加到“(where:{})”过滤器?或者以另一种方式获取过滤后的数据,而无需调出所有职位,也无需使用昂贵的数据。筛选器()?谢谢你的时间!!