You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Subscriptions must return a org.reactivestreams.Publisher for graphql-java to work properly. An exception will now be thrown if any return type of a top level subscription is not a subclass of Publisher
Fixes#359
Copy file name to clipboardExpand all lines: graphql-kotlin-schema-generator/src/main/kotlin/com/expediagroup/graphql/exceptions/InvalidSubscriptionTypeException.kt
Copy file name to clipboardExpand all lines: graphql-kotlin-schema-generator/src/main/kotlin/com/expediagroup/graphql/generator/types/SubscriptionBuilder.kt
Copy file name to clipboardExpand all lines: graphql-kotlin-schema-generator/src/test/kotlin/com/expediagroup/graphql/generator/types/SubscriptionBuilderTest.kt
+16-1
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ internal class SubscriptionBuilderTest : TypeTestHelper() {
41
41
}
42
42
43
43
@Test
44
-
fun`give a valid list, it should properly set the top level name`() {
44
+
fun`give a valid subscription class, it should properly set the top level name`() {
45
45
val builder =SubscriptionBuilder(generator)
46
46
val subscriptions =listOf(TopLevelObject(MyPublicTestSubscription()))
47
47
every { config.topLevelNames } returns TopLevelNames(subscription ="FooBar")
@@ -60,6 +60,16 @@ internal class SubscriptionBuilderTest : TypeTestHelper() {
60
60
}
61
61
}
62
62
63
+
@Test
64
+
fun`given a class with a function that does not return Publisher, it should throw an exception`() {
65
+
val builder =SubscriptionBuilder(generator)
66
+
val subscriptions =listOf(TopLevelObject(MyInvalidSubscriptionClass()))
0 commit comments