Hasura GraphQL with Yugabyte

by yugabyte

GitHub Readme.md

Hasura GraphQL Engine on Heroku Powered by Yugabyte Cloud

GitHub stars

The Heroku add-on integrates Yugabyte Cloud seamlessly with Heroku, a popular developer PaaS. It allows developers to use YugabyteDB as the system-of-record database for any of their Heroku apps. Through the add-on, Heroku users can quickly have their YugabyteDB running on AWS and GCP (Azure coming soon!). Using it is just as easy as you expect from any PaaS: simply add the add-on dependency to your Heroku app, and you’re good to go!

Hasura GraphQL Engine is a blazing-fast GraphQL server that gives you ⚡ instant, realtime GraphQL APIs over Yugabyte, with webhook triggers on database events for asynchronous business logic.

Hasura helps you build GraphQL apps backed by YugabyteDB or incrementally move to GraphQL for existing applications using Postgres.

Deploy Hasura GraphQL Engine with Yugabyte Cloud and get a GraphQL endpoint in under 30 seconds 🕐

Read more at Hasura docs or Yugabyte Cloud docs.

Quickstart

1. Deploy to Heroku

Deploy to Heroku and instantly get a realtime GraphQL API backed by Yugabyte Cloud add-on:

Deploy to Heroku

Create New App - Heroku

2. Open Hasura Console

Once the deployment is complete, click on the View button as marked above. This will take you to the Hasura Console, where you can create a table and make your first GraphQL query.

Hasura Console

3. Create a table

Navigate to Data -> Create table on the console and create a table called profile with the following columns:

name type id Integer (auto-increment) name Text

Choose id as the Primary key and click the Create button.

Hasura Console - Create table

4. Insert sample data

Once the table is created, go to the Insert Row tab and insert some sample rows:

Thor
Iron Man
Hulk
Captain America
Black Widow

Hasura Console - Insert rows

5. Try out GraphQL

Switch to the GraphiQL tab on top and execute the following GraphQL query:

query {
  profile {
    id
    name
  }
}

Hasura Console - GraphQL query

6. View your database console

Access your database console by going to your Heroku dashboard and clicking the add-on name.

Yugabyte Cloud - Heroku add-on

Then click "Go to cluster" to be redirected to the database console.

Yugabyte Cloud - List Clusters

Support & Troubleshooting

Feel free to talk to us on Slack about anything and everything. You can also contact us using one of the following channels:

What's next

Further reading