I am using react with graphQL and as a DB I use PostgreSQL.
so I have a list of records on my main screen and I want to change it when there's new record on my DB. my DB can be updated from different UI. so what's the best practice to update my FE without reloading whenever my DB records gets change.
as a joiner, I use react-apollo-hooks
for fetching graphQL data.
What I tried:
- web sockets
Ref links:
- https://scotch.io/tutorials/realtime-graphql-ui-updates-in-react-with-apollo
- https://www.smashingmagazine.com/2018/12/real-time-app-graphql-subscriptions-postgres/
Is there any other better way to fetch the latest data from BE?
EDIT: I know there are many way to achieve this but I want to know the best way to do that. like as per industry standard way.