-
Notifications
You must be signed in to change notification settings - Fork 323
Closed
Description
From #1131 (comment).
Extensions don't get included in WebSocket requests made with the GraphQlTester
.
Minimal example:
@Test
fun testSubscription() {
val client = StandardWebSocketClient()
// spring-graphql instance running on port 61686
val tester = WebSocketGraphQlTester
.builder("ws://localhost:61686/graphql", client)
.build()
val query = "subscription TestSubscription(\$accessCode: String!) { testSubscription(accessCode: \$accessCode) }"
val subscription = tester
.document(query)
.variable("accessCode", "testAccessCode")
.extension("x-test-extension", "testExtension")
.executeSubscription()
.toFlux()
StepVerifier
.create(subscription)
.expectNextMatches {
it.path("testSubscription").entity(String::class.java).get() == ""
}
.thenCancel()
.verify()
}
The test passes, but the server doesn't receive any extensions. It appears that this is caused by the AbstractGraphQlTesterBuilder which doesn't pass in extensions before executing its subscription.
Metadata
Metadata
Assignees
Labels
type: bugA general bugA general bug