Doug Chappelle
05/03/2021, 2:21 PMmbonnin
05/03/2021, 2:21 PMDoug Chappelle
05/03/2021, 2:24 PMmbonnin
05/03/2021, 2:25 PMDoug Chappelle
05/03/2021, 2:27 PMmbonnin
05/03/2021, 2:29 PMDoug Chappelle
05/03/2021, 3:00 PMmbonnin
05/03/2021, 3:01 PMapollo-coroutines-support
, Apollo 3 exposes a API interface by defaulttoFlow
to await
Doug Chappelle
05/03/2021, 3:23 PMapollo-coroutines-support
fixed my duplicate definition issue 😀val okHttpClient = OkHttpClient.Builder()
.addNetworkInterceptor(LoggingInterceptor())
.hostnameVerifier(NullHostNameVerifier())
.build()
wsClient = ApolloClient.builder()
.serverUrl("https://$host/websocket/realtime/websocket")
.subscriptionTransportFactory(WebSocketSubscriptionTransport.Factory("wss://$host/websocket/realtime/websocket", okHttpClient))
.subscriptionConnectionParams(SubscriptionConnectionParams(mapOf("x-vcs-token" to securityToken)))
.okHttpClient(okHttpClient)
.build()
New code where the subscription isn't even successful (timeout) 🤔
val wsFactory = ApolloWebSocketFactory("https://$host/websocket/realtime/websocket",
mapOf("Sec-WebSocket-Protocol" to "graphql-transport-ws"))
val transport = ApolloWebSocketNetworkTransport(wsFactory, mapOf("x-vcs-token" to securityToken))
wsClient = ApolloClient.Builder()
.subscriptionNetworkTransport(transport)
.networkTransport(transport)
.build()
mbonnin
05/03/2021, 6:22 PMgraphql-ws
and other thingsDoug Chappelle
05/03/2021, 6:46 PMmbonnin
05/03/2021, 6:47 PM./gradlew publishToMavenLocal
) and point your project to mavenLocal()
Doug Chappelle
05/03/2021, 9:42 PMval wsFactory = ApolloWebSocketFactory("https://$host/websocket/realtime/websocket")
val transport = ApolloWebSocketNetworkTransport(wsFactory, mapOf("x-vcs-token" to securityToken))
wsClient = ApolloClient.Builder()
.subscriptionNetworkTransport(transport)
.networkTransport(transport)
.build()
mbonnin
05/05/2021, 9:43 AMDoug Chappelle
05/05/2021, 12:49 PMFailed to retrieve TURN info: java.lang.ClassCastException: com.unify.vcs.realtime-svc-api.TurnInfoByIdQuery cannot be cast to com.apollographql.apollo3.api.Subscription
mbonnin
05/05/2021, 1:17 PMDoug Chappelle
05/05/2021, 2:18 PMmbonnin
05/05/2021, 2:27 PMDoug Chappelle
05/05/2021, 5:27 PMmbonnin
05/05/2021, 11:19 PMgraphql-ws
samples to work. I managed to get to the point where both client and server start but don't talk to each otherwss
instead of ws
🤦♂️Doug Chappelle
05/06/2021, 4:41 PMmbonnin
05/06/2021, 5:06 PMDoug Chappelle
05/06/2021, 9:24 PMmbonnin
05/06/2021, 9:32 PMDoug Chappelle
05/06/2021, 9:45 PMmbonnin
05/06/2021, 10:57 PM- webSocket.send(data)
+ webSocket.send(String(data.toByteArray()))
Isn't that the same thing ultimately?Doug Chappelle
05/07/2021, 12:16 PMmbonnin
05/11/2021, 8:44 AMDoug Chappelle
05/11/2021, 7:49 PMI didn't need to send the data as text, sending binary worked
mbonnin
05/11/2021, 7:51 PMDoug Chappelle
05/11/2021, 7:56 PMmbonnin
05/12/2021, 1:30 PM3.0.0-dev10
is out with configurable websocket protocol.WsFrameType.Binary
. To change to text, use
GraphQLWsProtocol(frameType = WsFrameType.Text)
Doug Chappelle
05/12/2021, 2:21 PMmbonnin
05/13/2021, 6:25 PMSubscriptionWsProtocol
but might have gone in GraphqlWsProtocol
it should be relatively easy to add it, feel free to send a PR. I'm off today and tomorrow but can look into this on MondayWsProtocol
I'm hoping this API can accommodate more custom use case like graphql-ws and maybe appsyncDoug Chappelle
05/13/2021, 7:10 PMmbonnin
05/17/2021, 8:56 AMDoug Chappelle
05/17/2021, 3:23 PMmbonnin
06/25/2021, 2:05 PMjob = launch {
val response = apolloClient.query(request)
// do something with response
}
// Cancel here if needed
job.cancel()
Doug Chappelle
07/09/2021, 6:26 PMmbonnin
07/09/2021, 9:19 PM"ACK not received after x amount of time"
should come from another attempt to read the WebSocket. Maybe a retry
?Doug Chappelle
07/12/2021, 1:19 PMmbonnin
07/12/2021, 1:23 PMDoug Chappelle
07/12/2021, 2:08 PMmbonnin
07/12/2021, 2:09 PMDoug Chappelle
07/12/2021, 2:11 PMmbonnin
07/12/2021, 2:12 PMgraphql-ws-server
to exhibit the error, that'd be super helpfulDoug Chappelle
07/12/2021, 3:07 PMmbonnin
07/12/2021, 3:11 PMDoug Chappelle
07/12/2021, 3:30 PMmbonnin
07/14/2021, 10:15 PMDoug Chappelle
07/15/2021, 1:27 PMmbonnin
07/15/2021, 1:35 PMDoug Chappelle
07/15/2021, 1:40 PM"Directs the executor to include this field or fragment only when the `if` argument is true"
directive @include(
"Included when true."
if: Boolean!
) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
"Directs the executor to skip this field or fragment when the `if`'argument is true."
directive @skip(
"Skipped when true."
if: Boolean!
) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
. . .
The schema is the same as I was using with v3.0.0-dev10mbonnin
07/15/2021, 1:42 PMWhen representing a GraphQL schema using the type system definition language any built-in directive may be omitted for brevity.That's a may, not a must so we should be robust to that. I'll make a fix
Doug Chappelle
07/15/2021, 2:23 PMmbonnin
07/15/2021, 3:45 PMDoug Chappelle
07/15/2021, 5:08 PMmbonnin
07/15/2021, 5:37 PMapollo-normalized-cache-sqlite
. Doing
rm -rf apollo-normalized-cache-sqlite/build
usually fixes it