-
Notifications
You must be signed in to change notification settings - Fork 662
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
Customizing your WebSocket protocol using GraphQLWsProtocol documentation #6253
Comments
Hi 👋 Can you share your |
Hey @martinbonnin, here is what im using:
|
Thanks for sending this 🙏 The issue comes from val client = ApolloClient.Builder()
.serverUrl(httpUrl)
.subscriptionNetworkTransport(
// subscriptions
WebSocketNetworkTransport.Builder()
.protocol(GraphQLWsProtocol.Factory())
.serverUrl(websocketUrl)
.okHttpClient(okHttpClient)
.build()
)
.networkTransport(
// queries/mutations
HttpNetworkTransport.Builder()
.okHttpClient(okHttpClient)
.build()
) |
Thanks @martinbonnin that fixed it! |
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Kotlin usage and allow us to serve you better. |
Question
The documentation for WebSocket protocol using GraphQLWsProtocol leads to the following exception:
Caused by: java.lang.IllegalStateException: Apollo: 'webSocketEngine' has no effect if 'subscriptionNetworkTransport' is set.
Is there additional documentation or guidance available that explains the correct setup for subscriptions using GraphQLWsProtocol? The exception does not provide clear guidance on how to resolve this issue.
The text was updated successfully, but these errors were encountered: