Skip to content

Commit

Permalink
fix: proxy hasura's rest endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarrosop committed Sep 20, 2023
1 parent 47b1b0f commit db11e2f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dockercompose/graphql.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func graphql( //nolint:funlen
{
Name: "hasura",
TLS: useTLS,
Rule: "( PathPrefix(`/v1`) || PathPrefix(`/v2`) || PathPrefix(`/console/assets`) ) && Host(`local.hasura.nhost.run`)", //nolint:lll
Rule: "( PathPrefix(`/v1`) || PathPrefix(`/v2`) || PathPrefix(`/api`) || PathPrefix(`/console/assets`) ) && Host(`local.hasura.nhost.run`)", //nolint:lll
Port: hasuraPort,
Rewrite: nil,
},
Expand Down
2 changes: 1 addition & 1 deletion dockercompose/graphql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func expectedGraphql() *Service {
"traefik.http.routers.graphql.service": "graphql",
"traefik.http.routers.graphql.tls": "false",
"traefik.http.routers.hasura.entrypoints": "web",
"traefik.http.routers.hasura.rule": "( PathPrefix(`/v1`) || PathPrefix(`/v2`) || PathPrefix(`/console/assets`) ) && Host(`local.hasura.nhost.run`)",
"traefik.http.routers.hasura.rule": "( PathPrefix(`/v1`) || PathPrefix(`/v2`) || PathPrefix(`/api`) || PathPrefix(`/console/assets`) ) && Host(`local.hasura.nhost.run`)",
"traefik.http.routers.hasura.service": "hasura",
"traefik.http.routers.hasura.tls": "false",
"traefik.http.services.graphql.loadbalancer.server.port": "8080",
Expand Down
4 changes: 3 additions & 1 deletion examples/myproject/nhost/metadata/allow_list.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
[]
- collection: allowed-queries
scope:
global: true
11 changes: 10 additions & 1 deletion examples/myproject/nhost/metadata/query_collections.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
[]
- name: allowed-queries
definition:
queries:
- name: animals
query: |
query animals {
animals {
name
}
}
10 changes: 9 additions & 1 deletion examples/myproject/nhost/metadata/rest_endpoints.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
[]
- comment: ""
definition:
query:
collection_name: allowed-queries
query_name: animals
methods:
- GET
name: animals
url: animals

0 comments on commit db11e2f

Please sign in to comment.