Filter Apollo connection with nested variables

Viewed 309

I'd like to specify a nested argument as the filter for my @connection directive. Is it possible to do something like this:

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 is passed in input. This is a contrived example and I know I can structure this differently, but my main questions is can I use nested arguments as a filter, or can I only use top-level arguments in that filter array? I didn't see any discussion of this in the docs.

0 Answers
Related