Skip to main content
Version: v2.x

Get Started with with Hasura Cloud & BigQuery

Navigate to cloud.hasura.io, and create a new Hasura Cloud account.

Once you create a project on Hasura Cloud, hit the "Launch Console" button to open the Hasura Console for your project.

Connect new or existing database

Connecting to a BigQuery project

Pre-requisites

Hasura GraphQL Engine requires the following to connect to a BigQuery project:

Creating a Service Account

  • In Google Cloud's console, head to your BigQuery project.

  • Go to IAM & Admin > Service Accounts > Create Service Account

Create new service account on GCP
  • Give it a name, and under roles, and grant these 3 roles:
    • BigQuery Metadata Viewer
    • BigQuery Data Viewer
    • BigQuery Job User
Add roles to service account on GCP
  • Click on the created service account, Keys > ADD KEY > Create New Key > JSON > Create. This will download a service account file on your computer.

Connect BigQuery to Hasura

  • Update Graphql Engine with an environment variable set to the contents of the service account.
Add BigQuery service account to Hasura
  • Head to the Console, in the Connect Existing Database page, choose Environment Variable under Connect Via, and fill in the necessary details:
Connect existing BigQuery database in Hasura Cloud

You should now be able to track the tables that are part of the specified tables and configure relationships between them. As BigQuery lacks foreign key constraints, the Hasura Console cannot suggest relationships, so all relationships between BigQuery tables have to be manually configured.

Try out a GraphQL query

Head to the API tab in the Console and try running a GraphQL query! Use the explorer sidebar on GraphQL to get help in creating a GraphQL query.

Make a GraphQL query with Hasura