Graphql 使用嵌套变量筛选Apollo连接
我想为我的Graphql 使用嵌套变量筛选Apollo连接,graphql,apollo,react-apollo,Graphql,Apollo,React Apollo,我想为我的@connection指令指定一个嵌套参数作为过滤器。是否可以这样做: input CommentsInput { postId: String! cursors: CommentsCursorInput } query getComments($input: CommentInput) { getComments(input: $input) @connection(key: "comments", filter: ["input.postId"]) {
@connection
指令指定一个嵌套参数作为过滤器。是否可以这样做:
input CommentsInput {
postId: String!
cursors: CommentsCursorInput
}
query getComments($input: CommentInput) {
getComments(input: $input)
@connection(key: "comments", filter: ["input.postId"]) {
comments {
id
commentBody
createdDate
liked
likeCount
}
}
}
postId
传入input
。这是一个精心设计的示例,我知道我可以用不同的结构,但我的主要问题是我可以使用嵌套参数作为过滤器,还是只能在过滤器
数组中使用顶级参数?我没有看到任何关于这个的讨论