diff --git a/graphcoolPlayground.go b/graphcoolPlayground.go index 43be574..dcca575 100644 --- a/graphcoolPlayground.go +++ b/graphcoolPlayground.go @@ -99,7 +99,8 @@ add "&raw" to the end of the URL within a browser. // options as 'endpoint' belong here endpoint: {{ .Endpoint }}, subscriptionEndpoint: {{ .SubscriptionEndpoint }}, - setTitle: {{ .SetTitle }} + setTitle: {{ .SetTitle }}, + settings: { "schema.polling.enable":false } }) }) diff --git a/graphiql.go b/graphiql.go index b024086..5b1a9d3 100644 --- a/graphiql.go +++ b/graphiql.go @@ -102,6 +102,8 @@ add "&raw" to the end of the URL within a browser. + + @@ -184,10 +186,12 @@ add "&raw" to the end of the URL within a browser. history.replaceState(null, null, locationQuery(parameters)); } + var subscriptionsClient = new SubscriptionsTransportWs.SubscriptionClient("ws://"+document.location.hostname+":"+ document.location.port+"/subscriptions", { reconnect: true }); + var subscriptionsFetcher = GraphiQLSubscriptionsFetcher.graphQLFetcher(subscriptionsClient,graphQLFetcher); // Render into the body. ReactDOM.render( React.createElement(GraphiQL, { - fetcher: graphQLFetcher, + fetcher: subscriptionsFetcher, onEditQuery: onEditQuery, onEditVariables: onEditVariables, onEditOperationName: onEditOperationName,