graphql-engine/community/examples/realtime-poll
Rakesh Emmadi f6ed169219 allow ordering using columns from object relationships (closes #463) (#672)
* allow ordering using columns from object relationships, close #463

* validate table fields in nested insert

* add tests

* add docs

* change 'table_order_by' type from enums to ordered map

* remove unwanted code from 'Schema.hs' file

* 'AnnGObject' is not list of field name and value tuple

* update docs for new order_by type

* use 'InsOrdHashMap' for 'AnnGObj'

* handle empty fields in order_by

* remove '_' prefixes for asc/desc

* fix the changed order_by syntax across the repo
2018-10-26 17:27:33 +05:30
..
hasura add community boilerplates and examples (#430) 2018-09-13 12:00:07 +05:30
public add community boilerplates and examples (#430) 2018-09-13 12:00:07 +05:30
src allow ordering using columns from object relationships (closes #463) (#672) 2018-10-26 17:27:33 +05:30
.eslintrc add community boilerplates and examples (#430) 2018-09-13 12:00:07 +05:30
.gitignore add community boilerplates and examples (#430) 2018-09-13 12:00:07 +05:30
.jsbeautifyrc add community boilerplates and examples (#430) 2018-09-13 12:00:07 +05:30
package-lock.json add community boilerplates and examples (#430) 2018-09-13 12:00:07 +05:30
package.json add community boilerplates and examples (#430) 2018-09-13 12:00:07 +05:30
README.md add community boilerplates and examples (#430) 2018-09-13 12:00:07 +05:30

hasura-realtime-poll

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.

Running the app yourself

  • Deploy Postgres and GraphQL Engine on Heroku:

    Deploy to
heroku

  • Get the Heroku app URL (say random-string-123.herokuapp.com)

  • Clone this repo:

    git clone https://github.com/hasura/graphql-engine
    cd graphql-engine/community/examples/realtime-poll
    
  • Install Hasura CLI

  • Goto hasura/ and edit config.yaml:

    endpoint: https://random-string-123.herokuapp.com
    
  • Apply the migrations:

    hasura migrate apply
    
  • Edit 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';
    
  • Run the app (go the root of repo):

    npm start