title: AppSync DynamoDB resolver for filtering use case
body: <p>I am working on an app which allows users to upload resources to the internet.</p>
  
  <p>I'm struggling with how to write a resolver for fetching resources posted by a specific user.</p>
  
  <p>I have 3 DynamoDB tables</p>
  
  <ul>
  <li><code>UserTable</code> -> a collection for user</li>
  <li><code>PostTable</code> -> a collection for resources</li>
  <li><code>PostUserTable</code> -> a collection for storing relations between User and Post</li>
  </ul>
  
  <p>In a traditional RDBS, it would be done by joining 2 tables(<code>UserTable</code> and <code>PostTable</code>) using <code>PostUserTable</code>. Even though DynamoDB, or any kinds of NoSQL database allows us to have a more flexible way to store data, I expect(hope) each user has many resources at the end of the day, so I decided to design tables in the same way as RDMS.</p>
  
  <p>But I'm not sure how you can write a resolver for filtering posts only by a specific user? I have a graphql query named <code>getMyPosts</code> and I want it to return posts uploaded by me.</p>