I have installed Apollo via SPM version 1.14.0. It does not give you the option to install ApolloWebSocket. I try to implement the documentation code for subscriptions. But it fails to recognize WebSocketTransport or even WebSocket. It states “Cannot find type ‘WebSocketClient’ in scope” and then tells me to impor WebSocketApollo. It doesn’t let me import WebSocketApollo.
let webSocketTransport: WebSocketTransport = {
let url = URL(string: "ws://localhost:8080/websocket")!
let webSocketClient = WebSocket(url: url, protocol: .graphql_transport_ws)
let authPayload: JSONEncodableDictionary = ["authToken": myAuthToken]
let config = WebSocketTransport.Configuration(connectingPayload: authPayload)
return WebSocketTransport(websocket: webSocketClient, config: config)
}()
The documentation is somehow out of date for SPM or I am doing something wrong. I can implement subscriptions in my project right now, but I am not getting any actual data responses right now. I can not figure out what is going on.