Playground removed URL path?
- Lingua principale
- Go
- Stelle
- 10.8k
- Fork
- 1.3k
- Merge medio
- 2g 36m
- PR unite (30g)
- 26
Descrizione
### Discussed in https://github.com/99designs/gqlgen/discussions/2030
Originally posted by **mxcoppell** March 3, 2022
All,
Got into an issue when deploying the playground into the pod. If the URL for the playground is:
`https://playground-host:port/myinstance/test/playground`
The endpoint portion is "/test/playground" supplied to the playground handler.
With the value of GraphQL handler endpoint "/test/graphql", The GraphQL URL in the playground page will be:
`https://playground-host:port/test/playground`
The path portion "/myinstance" of the base URL is stripped. And the playground page reports service is not reachable.
However, if there is no addition path portion to the base URL, the GraphQL service URL in playground is correct.
`https://playground-host:port/test/playground`
And playground parses the GraphQL service URL correctly:
`https://playground-host:port/test/playground`
From https://github.com/99designs/gqlgen/blob/master/graphql/playground/playground.go, the "url" is created by location.host + endpoint. Not sure how the "location.host" is generated.
`const url = location.protocol + '//' + location.host + '{{.endpoint}}';`
Thanks!
-Min
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.