Add ability to configure GraphcoolPlayground endpoint + subscription endpoint #86
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello! I've been using graphql-go successfully in my app for a while now, but I've had to use a standalone GraphQL client for testing because the handler package's bundled GraphiQL doesn't support HTTP headers, and the bundled Playground don't allow me to change the websocket endpoint.
Right now the endpoint and websocket endpoint are hardcoded in this package to be relative to the request's url, but this doesn't work in cases where the websocket is served off of a different subdomain. Also the "ws" protocol is hardcoded but in production environments, most people are using "wss".
This proposed change allows users to optionally pass an additional PlaygroundConfig object in the main Handler Config which can change the endpoint and subscription endpoint. If it's not included, but the Playground flag is true, the original behavior is retained so as not to break existing users.
If you have a better idea of how to accomplish this, I'm all ears! I'd just love to be able to do all of my testing from a web browser without needing some Electron app as well.