nautilus / gateway

A federated api gateway for graphql services. https://gateway.nautilus.dev/
MIT License
397 stars 49 forks source link

Add configurable playground HTTP handler #169

Closed JohnStarich closed 2 years ago

JohnStarich commented 2 years ago

Adds a new HTTP handler that serves a configurable playground UI. Unlike the existing gateway.PlaygroundHandler() method, this one serves the static UI only and allows for some critical settings like request headers.

Also updates the version of the playground to the latest.

~I did convert cmd/gateway to use the new static handler initially in e9cf88cf7daccf88282477a3e962c6d50fc92c6c, but I reverted it because we're not using any of the custom options yet.~ I decided to keep it after all: It makes it easier to use the gateway for the first time (don't need to remember to visit /graphql) and doesn't negatively impact previous users.

Closes https://github.com/nautilus/gateway/issues/158 Closes https://github.com/nautilus/gateway/issues/120