Skip to content

Commit

Permalink
change argument name to connectionPayload (#6103)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinbonnin authored Aug 7, 2024
1 parent 678fd10 commit 6684a79
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ 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"

override suspend fun connectionInit(): ClientMessage {
val map = mutableMapOf<String, Any?>()
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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ 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"

override suspend fun connectionInit(): ClientMessage {
val map = mutableMapOf<String, Any?>()
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()
Expand Down

0 comments on commit 6684a79

Please sign in to comment.