re: Data Modeling in Depth with GraphQL & AWS Amplify - 17 Data Access Patterns VIEW POST

re: Hello Nader, Thanks a lot for your article, very interesting. However, I don't know if I can do what I want to do using DynamoDB. It seems what I ...

Hey Ricardo,
I'm obviously not Nader, but what if you created two tables "users" and "userLikes"? When someone clicks the like button, you create a new "userLike" document where you have a liker and a likee field? You could then easily do lookups based on the liker and likee, especially if you added them as one to many relationships on the "user" document. This would be the basic relationships:

user {
   admirers: [userLikes]
   crushes: [userLikes]

userLikes {
   liker: user
   likee: user
   isBlocked: boolean/string

You could add latitude/longitude and use the between that Nader mentions above and then use booleans for some of those other specifications such as blocked.

code of conduct - report abuse