Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GraphQLWsProtocol.Factory.webSocketPayloadComposer (#4589)
* Add GraphQLWsProtocol.Factory.webSocketPayloadComposer * update APIDump
- Loading branch information
1 parent
07154ef
commit 3f7e81b
Showing
5 changed files
with
134 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...c/commonMain/kotlin/com/apollographql/apollo3/api/http/DefaultWebSocketPayloadComposer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.apollographql.apollo3.api.http | ||
|
||
import com.apollographql.apollo3.annotations.ApolloExperimental | ||
import com.apollographql.apollo3.api.ApolloRequest | ||
import com.apollographql.apollo3.api.Operation | ||
|
||
@ApolloExperimental | ||
class DefaultWebSocketPayloadComposer: WebSocketPayloadComposer { | ||
override fun <D : Operation.Data> compose(apolloRequest: ApolloRequest<D>): Map<String, Any?> { | ||
return DefaultHttpRequestComposer.composePayload(apolloRequest) | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...-api/src/commonMain/kotlin/com/apollographql/apollo3/api/http/WebSocketPayloadComposer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.apollographql.apollo3.api.http | ||
|
||
import com.apollographql.apollo3.annotations.ApolloExperimental | ||
import com.apollographql.apollo3.api.ApolloRequest | ||
import com.apollographql.apollo3.api.Operation | ||
|
||
/** | ||
* [WebSocketPayloadComposer] transforms a GraphQL request in a payload to be sent in a WebSocket message | ||
* | ||
* See [HttpRequestComposer] | ||
*/ | ||
@ApolloExperimental | ||
interface WebSocketPayloadComposer { | ||
fun <D : Operation.Data> compose(apolloRequest: ApolloRequest<D>): Map<String, Any?> | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters