Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift Package Manager Apollo Web Socket Not Working #3421

Closed
danielchangsoojones opened this issue Aug 1, 2024 · 2 comments
Closed

Swift Package Manager Apollo Web Socket Not Working #3421

danielchangsoojones opened this issue Aug 1, 2024 · 2 comments
Labels
question Issues that have a question which should be addressed

Comments

@danielchangsoojones
Copy link

Question

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.

@danielchangsoojones danielchangsoojones added the question Issues that have a question which should be addressed label Aug 1, 2024
Copy link
Contributor

github-actions bot commented Aug 1, 2024

Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better.

Copy link
Contributor

github-actions bot commented Aug 1, 2024

Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Issues that have a question which should be addressed
Projects
None yet
Development

No branches or pull requests

1 participant