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<
170
170
} `
171
171
}
172
172
173
- return endpoint
173
+ return endpoint . replace ( / ^ h t t p / , 'ws' )
174
174
}
175
175
176
176
componentWillReceiveProps ( nextProps : PlaygroundWrapperProps & ReduxProps ) {
@@ -253,7 +253,9 @@ class PlaygroundWrapper extends React.Component<
253
253
activeEnv . projectName ,
254
254
)
255
255
const endpoint = endpoints . endpoint
256
- const subscriptionEndpoint = endpoints . subscriptionEndpoint
256
+ const subscriptionEndpoint =
257
+ endpoints . subscriptionEndpoint ||
258
+ this . normalizeSubscriptionUrl ( endpoint , endpoints . subscriptionEndpoint )
257
259
const headers = endpoints . headers
258
260
this . setState ( {
259
261
endpoint,
Original file line number Diff line number Diff line change @@ -74,8 +74,10 @@ export const defaultLinkCreator = (
74
74
return { link : httpLink }
75
75
}
76
76
77
+ const finalSubscriptionsEndpoint = wsEndpoint || subscriptionEndpoint
78
+
77
79
const subscriptionClient = new SubscriptionClient (
78
- wsEndpoint || subscriptionEndpoint ,
80
+ finalSubscriptionsEndpoint ,
79
81
{
80
82
timeout : 20000 ,
81
83
lazy : true ,
You can’t perform that action at this time.
0 commit comments