You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -110,13 +115,45 @@ a loop for incoming messages and errors:
110
115
case err = <-errChan:
111
116
return
112
117
case<-time.After(time.Minute):
113
-
err = wsClient.Unsubscribe(subscriptionID)
118
+
err = graphqlClient.Unsubscribe(subscriptionID)
114
119
loop = false
115
120
}
116
121
}
117
122
```
118
123
119
124
To change the websocket protocol from its default value `graphql-transport-ws`, add the following header before calling `graphql.NewClientUsingWebSocket()`:
Graphql allows to authenticate subscriptions using HTTP headers (inside the http upgrade request) or using connection parameters (first message inside the websocket connection).
133
+
To authenticate using both methods, you need to add a `graphql.WebSocketOption` to the `graphql.NewClientUsingWebSocket` method.
0 commit comments