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
val sourceName =if (field.sourceLocation !=null&& field.sourceLocation.sourceName !=null) field.sourceLocation.sourceName else"<unknown>"
175
198
val sourceLocation =if (field.sourceLocation !=null) "$sourceName:${field.sourceLocation.line}"else"<unknown>"
176
-
return"No method${if (scannedProperties) " or field"else""} found as defined in schema $sourceLocation with any of the following signatures (with or without one of $allowedLastArgumentTypes as the last argument), in priority order:\n${signatures.joinToString("\n")}"
199
+
return"No method${if (scannedProperties) " or field"else""} found as defined in schema $sourceLocation with any of the following signatures "+
200
+
"(with or without one of $allowedLastArgumentTypes as the last argument), in priority order:\n${signatures.joinToString("\n")}"+
201
+
if (isSubscription) "\n\nNote that a Subscription data fetcher must return a Publisher of events"else""
Copy file name to clipboardExpand all lines: src/test/kotlin/graphql/kickstart/tools/SchemaParserTest.kt
+40Lines changed: 40 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -662,4 +662,44 @@ class SchemaParserTest {
662
662
}
663
663
}
664
664
}
665
+
666
+
@Test
667
+
fun`parser should verify subscription resolver return type`() {
668
+
val error = assertThrows(FieldResolverError::class.java) {
669
+
SchemaParser.newParser()
670
+
.schemaString(
671
+
"""
672
+
type Subscription {
673
+
onItemCreated: Int!
674
+
}
675
+
676
+
type Query {
677
+
test: String
678
+
}
679
+
"""
680
+
)
681
+
.resolvers(
682
+
Subscription(),
683
+
object:GraphQLQueryResolver { funtest() ="test" }
684
+
)
685
+
.build()
686
+
.makeExecutableSchema()
687
+
}
688
+
689
+
val expected ="""
690
+
No method or field found as defined in schema <unknown>:3 with any of the following signatures (with or without one of [interface graphql.schema.DataFetchingEnvironment, class graphql.GraphQLContext] as the last argument), in priority order:
0 commit comments