TownHallHQ / TownHall

MIT License
30 stars 13 forks source link

Capability to Follow Users #99

Closed EstebanBorai closed 11 months ago

EstebanBorai commented 1 year ago

Capability to follow a user. This will allow users to have a personalized experience.

Tasks

Introduce the user_follow table

Introduce a user_follow table which follows the Many to Many relationship to track user follows.

Columns would be

Name Data Type Description
IDX_ follower_followee Index PK An index made of the Follower User ID (Pxid) and Followee User ID (Pxid)
follower Pxid The ID from the user who follows
followee Pxid The ID from the user being followed by follower
created_at Timestamp Moment where the follower started following

By using the index we avoid duplicated followers

Introduce GraphQL Operations

follow(id: Pxid): Follow

Follows the user with the provided ID and returns a Follow object which contains the operation summary.

unfollow(id: Pxid): Unfollow

Unfollows the user with the provided ID and returns a Unfollow object which contains the operation summary.