How to implement graphql subscription using apollo ios client

后端 未结 3 499
故里飘歌
故里飘歌 2021-01-12 22:32

I am trying to implement graphql subscription using apollo ios client. But not able to figure it out as lack of documentation examples. Example given on apollo documentation

3条回答
  •  别那么骄傲
    2021-01-12 22:48

    Here's my ApolloClient setup for just a web socket transport client:

    let connectingPayload = ["authToken": accessToken]
    let urlRequest = URLRequest(url: baseURL)
    let webSocketTransport = WebSocketTransport(request: urlRequest, sendOperationIdentifiers: false, connectingPayload: connectingPayload)
    
    let apollo = ApolloClient(networkTransport: webSocketTransport)
    

提交回复
热议问题