File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
packages/graphql-playground-react/src Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -170,7 +170,7 @@ class PlaygroundWrapper extends React.Component<
170170 } `
171171 }
172172
173- return endpoint
173+ return endpoint . replace ( / ^ h t t p / , 'ws' )
174174 }
175175
176176 componentWillReceiveProps ( nextProps : PlaygroundWrapperProps & ReduxProps ) {
@@ -253,7 +253,9 @@ class PlaygroundWrapper extends React.Component<
253253 activeEnv . projectName ,
254254 )
255255 const endpoint = endpoints . endpoint
256- const subscriptionEndpoint = endpoints . subscriptionEndpoint
256+ const subscriptionEndpoint =
257+ endpoints . subscriptionEndpoint ||
258+ this . normalizeSubscriptionUrl ( endpoint , endpoints . subscriptionEndpoint )
257259 const headers = endpoints . headers
258260 this . setState ( {
259261 endpoint,
Original file line number Diff line number Diff line change @@ -74,8 +74,10 @@ export const defaultLinkCreator = (
7474 return { link : httpLink }
7575 }
7676
77+ const finalSubscriptionsEndpoint = wsEndpoint || subscriptionEndpoint
78+
7779 const subscriptionClient = new SubscriptionClient (
78- wsEndpoint || subscriptionEndpoint ,
80+ finalSubscriptionsEndpoint ,
7981 {
8082 timeout : 20000 ,
8183 lazy : true ,
You can’t perform that action at this time.
0 commit comments