amazon web services – Filter main table by sub / sub field relation

Seeing this query:

query ListPosts(
    $filter: ModelPostFilterInput
    $limit: Int
    $nextToken: String
  ) {
    listPosts(filter: $filter, limit: $limit, nextToken: $nextToken) {
      items {
        id
        title
        description
        personID
        media {
          items {
            id
            type
            postID
            taggedPersons{
              items {
                id
                personID
                mediaID
              }
              nextToken
            }
          }
          nextToken
        }
      }
    }
  }

I would like to filter the posts:

  1. Where the owner has a personID {filter:{personID:{eq: $personID}}}
  2. OR where the person is in the taggedPersons list

Getting the post by this sub sub relation I can’t figure out. How would I do this?

Read more here: Source link