Skip to content
This repository has been archived by the owner on Jun 5, 2019. It is now read-only.

Latest commit

 

History

History
49 lines (35 loc) · 1.53 KB

README.md

File metadata and controls

49 lines (35 loc) · 1.53 KB

gatsby-source-hasura

Boilerplate to get started with Gatsby, Hasura GraphQL engine as CMS and postgres as database using the awesome plugin wyze/gatsby-source-graphql.

Running the app yourself

  • Deploy Postgres and GraphQL Engine on Heroku:

    Deploy to heroku

  • Get the Heroku app URL (say hasura-graphql-2.herokuapp.com)

  • Clone this repo:

    git clone https://github.com/hasura/gatsby-source-hasura.git
    cd gatsby-source-hasura
  • Install Hasura CLI

  • Goto hasura/ and edit config.yaml:

    endpoint: https://hasura-graphql-2.herokuapp.com
  • Create author table:

    • Open Hasura console:

      hasura console
    • Navigate to Data section in the top nav bar and create a table as follows:

      Create author table

  • Insert sample data into author table:

    Insert data into author table

    Verify if the row is inserted successfully

    Insert data into author table

  • Run the app (go to the root of the repo):

    HASURA_GRAPHQL_URL=https://hasura-graphql-2.herokuapp.com/v1alpha1/graphql npm run develop
  • Test the app Visit http://localhost:8000 to view the app

    Demo app