Skip to content

Commit d34f105

Browse files
committed
Rename EndpointURLWS to SubscriptionEndpoint
1 parent aace1d0 commit d34f105

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

graphiql.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type graphiqlPage struct {
1818
VariablesString string
1919
OperationName string
2020
Endpoint template.URL
21-
EndpointURLWS template.URL
21+
SubscriptionEndpoint template.URL
2222
UsingHTTP bool
2323
UsingWS bool
2424
}
@@ -59,12 +59,12 @@ func renderGraphiQL(w http.ResponseWriter, params graphql.Params, handler Handle
5959
isEndpointUsingWS := strings.HasPrefix(handler.Endpoint, "ws://")
6060
UsingHTTP := !isEndpointUsingWS
6161
UsingWS := isEndpointUsingWS || handler.SubscriptionsEndpoint != ""
62-
EndpointURLWS := ""
62+
SubscriptionEndpoint := ""
6363
if UsingWS {
6464
if isEndpointUsingWS {
65-
EndpointURLWS = handler.Endpoint
65+
SubscriptionEndpoint = handler.Endpoint
6666
} else {
67-
EndpointURLWS = handler.SubscriptionsEndpoint
67+
SubscriptionEndpoint = handler.SubscriptionsEndpoint
6868
}
6969
}
7070

@@ -76,7 +76,7 @@ func renderGraphiQL(w http.ResponseWriter, params graphql.Params, handler Handle
7676
VariablesString: varsString,
7777
OperationName: params.OperationName,
7878
Endpoint: template.URL(handler.Endpoint),
79-
EndpointURLWS: template.URL(EndpointURLWS),
79+
SubscriptionEndpoint: template.URL(SubscriptionEndpoint),
8080
UsingHTTP: UsingHTTP,
8181
UsingWS: UsingWS,
8282
}
@@ -172,7 +172,7 @@ add "&raw" to the end of the URL within a browser.
172172
}
173173
174174
{{ if .UsingWS }}
175-
var subscriptionsClient = new window.SubscriptionsTransportWs.SubscriptionClient({{ .EndpointURLWS }}, {
175+
var subscriptionsClient = new window.SubscriptionsTransportWs.SubscriptionClient({{ .SubscriptionEndpoint }}, {
176176
reconnect: true
177177
});
178178
var graphQLWSFetcher = subscriptionsClient.request.bind(subscriptionsClient);

0 commit comments

Comments
 (0)