A Serverless project to create an API Gateway and Lambda function to access the Hasura API via a /graphql endpoint. The Lambda currently adds a couple Hasura specific headers and passes the request directly to Hasura.
TODO:
- Use code-gen for specific user roles
- Add schema validation based on user
This is a work horse container, it has access to generate dummy data and post it directly to the database.
A Hasura container.
A Postgres DB container.
POST http://0.0.0.0:3000/dev/graphql
_Example GraphQL Request:
query MyQuery {
files(order_by: {created_at: asc}, limit: 100) {
id
filename
}
}
Remove all data, reset Auto-Increment ID:
TRUNCATE <table name> RESTART IDENTITY;
Get the total count of rows:
SELECT COUNT(*) FROM <table name>;
Exporting Database Schema:
pg_dump -c -v -h $POSTGRES_HOST -U $POSTGRES_USER -d $POSTGRES_DB > example.sql
OR
pg_dump -c -v postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST/$POSTGRES_DB > example.sql