A demo application to showcase real-time capabilities of Hasura GraphQL Engine.
The Realtime Poll application is built using React and is powered by Hasura GraphQL Engine over Postgres. It has an interface for users to cast vote on a poll and the results are updated in the on-screen bar chart, in real-time.
The application makes use of Hasura GraphQL Engine’s real-time capabilities
using subscription
. There is no backend code involved. The application is
hosted on GitHub pages and the Postgres+GraphQL Engine is running on Postgres.
Deploy Postgres and GraphQL Engine on Heroku:
random-string-123.herokuapp.com
)git clone https://github.com/hasura/graphql-engine
cd graphql-engine/community/sample-apps/realtime-poll
hasura/
and edit config.yaml
:
endpoint: https://random-string-123.herokuapp.com
hasura migrate apply
HASURA_GRAPHQL_ENGINE_HOSTNAME
in src/apollo.js
and set it to the
Heroku app URL:
export const HASURA_GRAPHQL_ENGINE_HOSTNAME = 'random-string-123.herokuapp.com';
npm install
npm start