@Test
fun `errors during operation execution should not stop other operations`() {
val response = testedSchema.executeBlocking(
"""
{
number1: number(big: true)
exception1: exception
nullableException1: nullableException
number2: number(big: true)
exception2: exception
nullableException2: nullableException
}
""".trimIndent()
)
response.deserialize()["data"] shouldBe mapOf(
"number1" to 10000,
"nullableException1" to null,
"number2" to 10000,
"nullableException2" to null
)
}
According to the GraphQL spec, errors on non-nullable fields propagate to their parent. This works correctly for nested fields but not for root level fields:
Actually, errors on non nullable operations should stop other operations and return
{ data: null }.See also:
Further reading: