Skip to content

chore(gateway): Expose GraphQL API #1310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,6 @@ ENABLE_RESPONSES=false
# GraphQL
# ------------

HASURA_URL=http://hasura:8080
HASURA_CLAIMS_MAP='{"x-hasura-allowed-roles":{"path":"$.hasura.all_roles","default":["user"]},"x-hasura-default-role":{"path":"$.hasura.all_roles[0]","default":"user"},"x-hasura-user-id":{"path":"$.sub"}}'
HASURA_ADMIN_SECRET=<your_hasura_admin_secret>
1 change: 1 addition & 0 deletions gateway/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ services:
- JWT_SHARED_KEY=${JWT_SHARED_KEY}
- AGENTS_API_URL=${AGENTS_API_URL:-http://agents-api-multi-tenant:8080}
- TEMPORAL_UI_PUBLIC_URL=${TEMPORAL_UI_PUBLIC_URL:-http://temporal-ui-public:8080}
- HASURA_URL=${HASURA_URL:-http://hasura:8080}
- AGENTS_API_KEY=${AGENTS_API_KEY}
- AGENTS_API_KEY_HEADER_NAME=${AGENTS_API_KEY_HEADER_NAME:-Authorization}
- TRAEFIK_LOG_LEVEL=${TRAEFIK_LOG_LEVEL:-INFO}
Expand Down
1 change: 1 addition & 0 deletions gateway/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ AGENTS_API_URL=${AGENTS_API_URL:-http://agents-api:8080}
AGENTS_API_KEY_HEADER_NAME=${AGENTS_API_KEY_HEADER_NAME:-Authorization}
GATEWAY_PORT=${GATEWAY_PORT:-80}
TEMPORAL_UI_PUBLIC_URL=${TEMPORAL_UI_PUBLIC_URL:-http://temporal-ui-public:8080}
HASURA_URL=${HASURA_URL:-http://hasura:8080}

for var_name in JWT_SHARED_KEY AGENTS_API_KEY
do
Expand Down
15 changes: 15 additions & 0 deletions gateway/traefik.yml.template
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ http:
service: service-temporal-ui-public
priority: 2

hasura:
entryPoints:
- web
rule: PathPrefix(`/v1/graphql`)
middlewares:
- corsHeaders
service: service-hasura
priority: 3

middlewares:
corsHeaders:
headers:
Expand Down Expand Up @@ -150,6 +159,12 @@ http:
servers:
- url: $TEMPORAL_UI_PUBLIC_URL

service-hasura:
loadBalancer:
passHostHeader: false
servers:
- url: $HASURA_URL

experimental:
localPlugins:
jwt:
Expand Down
1 change: 1 addition & 0 deletions hasura/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ services:
- "8086:8080"
environment:
HASURA_GRAPHQL_DATABASE_URL: ${PG_DSN:-postgres://postgres:postgres@memory-store:5432/postgres?sslmode=disable}
HASURA_GRAPHQL_SERVER_PORT: 8080
HASURA_GRAPHQL_ENABLE_CONSOLE: "true"
HASURA_GRAPHQL_DEV_MODE: "true"
HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
Expand Down