diff --git a/libraries/apollo-runtime/src/commonMain/kotlin/com/apollographql/apollo/network/websocket/GraphQLWsProtocol.kt b/libraries/apollo-runtime/src/commonMain/kotlin/com/apollographql/apollo/network/websocket/GraphQLWsProtocol.kt index b77f0bf53e7..999626c3622 100644 --- a/libraries/apollo-runtime/src/commonMain/kotlin/com/apollographql/apollo/network/websocket/GraphQLWsProtocol.kt +++ b/libraries/apollo-runtime/src/commonMain/kotlin/com/apollographql/apollo/network/websocket/GraphQLWsProtocol.kt @@ -15,7 +15,7 @@ import okio.Buffer */ @ApolloExperimental class GraphQLWsProtocol( - val connectionParams: suspend () -> Any? = { null }, + val connectionPayload: suspend () -> Any? = { null }, ) : WsProtocol { override val name: String get() = "graphql-transport-ws" @@ -23,9 +23,9 @@ class GraphQLWsProtocol( override suspend fun connectionInit(): ClientMessage { val map = mutableMapOf() map.put("type", "connection_init") - val params = connectionParams() - if (params != null) { - map.put("payload", params) + val payload = connectionPayload() + if (payload != null) { + map.put("payload", payload) } return map.toClientMessage() diff --git a/libraries/apollo-runtime/src/commonMain/kotlin/com/apollographql/apollo/network/websocket/SubscriptionWsProtocol.kt b/libraries/apollo-runtime/src/commonMain/kotlin/com/apollographql/apollo/network/websocket/SubscriptionWsProtocol.kt index ce92a8a4fa6..d6655bfbe8d 100644 --- a/libraries/apollo-runtime/src/commonMain/kotlin/com/apollographql/apollo/network/websocket/SubscriptionWsProtocol.kt +++ b/libraries/apollo-runtime/src/commonMain/kotlin/com/apollographql/apollo/network/websocket/SubscriptionWsProtocol.kt @@ -19,7 +19,7 @@ import okio.Buffer @Deprecated("Migrate your server to GraphQLWsProtocol instead") @ApolloDeprecatedSince(ApolloDeprecatedSince.Version.v4_0_0) class SubscriptionWsProtocol( - val connectionParams: suspend () -> Any? = { null }, + val connectionPayload: suspend () -> Any? = { null }, ) : WsProtocol { override val name: String get() = "graphql-ws" @@ -27,9 +27,9 @@ class SubscriptionWsProtocol( override suspend fun connectionInit(): ClientMessage { val map = mutableMapOf() map.put("type", "connection_init") - val params = connectionParams() - if (params != null) { - map.put("payload", params) + val payload = connectionPayload() + if (payload != null) { + map.put("payload", payload) } return map.toClientMessage()