The following test fails:
@Test
fun test() {
val schemaString = """
type Query {
cat: Cat!
}
type Cat {
foo1: String!
foo2: String!
}
""".trimIndent()
val documentString = """
query GetCat {
cat {
foo1
foo1: foo2
}
}
""".trimIndent()
val typeDefinitionRegistry = SchemaParser().parse(schemaString)
val document = Parser().parseDocument(documentString)
val graphQLSchema = SchemaGenerator().makeExecutableSchema(typeDefinitionRegistry, RuntimeWiring.newRuntimeWiring().build())
val result = Validator().validateDocument(graphQLSchema, document, Locale.US)
// There should be a validation error at this point.
check(result.isNotEmpty())
}
I would expect a validation error because foo1 and foo1: foo2 cannot be merged.
Edit: this is on version 21.1
The following test fails:
@Test fun test() { val schemaString = """ type Query { cat: Cat! } type Cat { foo1: String! foo2: String! } """.trimIndent() val documentString = """ query GetCat { cat { foo1 foo1: foo2 } } """.trimIndent() val typeDefinitionRegistry = SchemaParser().parse(schemaString) val document = Parser().parseDocument(documentString) val graphQLSchema = SchemaGenerator().makeExecutableSchema(typeDefinitionRegistry, RuntimeWiring.newRuntimeWiring().build()) val result = Validator().validateDocument(graphQLSchema, document, Locale.US) // There should be a validation error at this point. check(result.isNotEmpty()) }I would expect a validation error because
foo1andfoo1: foo2cannot be merged.Edit: this is on version
21.1