Skip to main content

PostgreSQL 14 Database Refresher :: Working with GraphQL

Shenzhen, China

Hasura GraphQL

The Hasura GraphQL engine makes your data instantly accessible over a real-time GraphQL API, so you can build and ship modern apps and APIs faster. Hasura connects to your databases, REST servers, GraphQL servers, and third party APIs to provide a unified realtime GraphQL API across all your data sources.

This guide will help you get the Hasura GraphQL engine and a Postgres database to store its metadata running as Docker containers using Docker Compose. This is the easiest way to set up Hasura GraphQL engine on your local environment.


This sets up both Postgres v12 and Hasura GraphQL:

The hasura/graphql-engine/install-manifests repo contains all installation manifests required to deploy Hasura anywhere. Get the docker compose file from there:

curl -o docker-compose.yml

The following command will run Hasura GraphQL engine along with a Postgres database to store its metadata.

docker-compose up -d


This works without issues with my Postgres v14 docker installation on host

docker run -d -p 8080:8080 \
-e HASURA_GRAPHQL_DATABASE_URL=postgresql://postgres:secretpassword@ \
-e HASURA_GRAPHQL_ENABLE_CONSOLE=true --name=hasura --rm \

After the container is started visit the IP of your docker host on port 8080. Go to data and track all your data:

Postgres Hasura GraphQL

I can now query the data from my PG database using Graph queries in GraphiQL:

boards(where: { board_id: { _eq: 39 } }) {
comments(where: { board_id: { _eq: 39 } }) {

Postgres Hasura GraphQL