graphql-go / handler

Golang HTTP.Handler for graphl-go
MIT License
445 stars 134 forks source link

Add a way to configure the GraphiQL subscription endpoint #31

Open Jannis opened 6 years ago

Jannis commented 6 years ago

The current GraphiQL interface served by the handler sends GraphQL subscriptions over HTTP, which is not expected to work. This article describes how GraphiQL can be set up with a custom fetcher that does subscriptions over a GraphQL WebSocket.

It would be great if the handler would support this to work with GraphQL servers that implement WS subscriptions.

kivutar commented 6 years ago

This is an example implementation from apollo-server: https://github.com/apollographql/apollo-server/blob/5d15abc681ffc43c2ce1d68d728814b8dbcf91b8/packages/apollo-server-module-graphiql/src/renderGraphiQL.ts