Intent is to allow for a quick and simple boilerplate from the Hasura PGJWT scripts, with an initial schema defined as code in the SQL files here.
docker-compose up -d
# load the metadata
python3 replace_metadata.py
Environment variables can also be set in the .env
file.
- Hasura instance will be running at http://localhost:8080 and can be accessed using
adminsecret
. - PgAdmin4 instance will be running at http://localhost:5050 (login:
admin
/password
). Note: usepostgres
as hostname andpostgres
as username. - The database will have the hasura-jwt-auth service installed and ready to go.
Role is anonymous:
query Auth {
hasura_auth(args: {email: "[email protected]", cleartext_password: "password"}) {
jwt_token
}
}
Use the token in the Authorization: Bearer ${jwt_token}
header.
query Todos {
hasura_user {
id
email
todos {
title
is_public
is_completed
}
}
}
Notice that you see all the todos of your own user and all the public todo's of the other users.
# connect with psql
docker exec -u postgres -t -i postgres psql example
# \dt lists the tables
# \df lists the functions
docker-compose down && docker volume prune -f