7. GraphQL & Realtime
• Required data varies over pages and releases
• Almost every data should be realtime
• Feature that would be added in the future
should also be realtime
12. Subscribe keys by websocket, actioncable(rails), etc
subscribe key for normal changes
for user-specific changes
(ex: comment.myReaction, user.isFriend)
14. Rails side
created a reaction to comment 10 with id=123
notification { add reaction 123 } to comment 10
Use ActiveRecord s database commit callbacks
15. Rails side
Use ActiveRecord s database commit callbacks
kind changed → comment.reactionSummary changes
notification { update reactionSummary } to comment 10
16. Rails side
comment_id changed from 10 to 20 → parent is changed
notification { remove reaction id=123 } to comment 10
notification { add reaction id=123 } to comment 20
Use ActiveRecord s database commit callbacks
17. event { add id: 10 } came to "d17e3f62/reactions"
1. fetch
2. add
3. subscribe new keys
+