Skip to content

Incorrect null propagation for root fields #645

Description

@stuebingerb

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:

@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
    )
}

Actually, errors on non nullable operations should stop other operations and return { data: null }.

See also:

Further reading:

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions