From 3c07676f7fc6b43ce7e9ff76a0e8ecc1336168c9 Mon Sep 17 00:00:00 2001 From: Andreas Marek Date: Thu, 15 May 2025 11:22:33 +1000 Subject: [PATCH 1/2] add defer test case --- ...eferExecutionSupportIntegrationTest.groovy | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/test/groovy/graphql/execution/incremental/DeferExecutionSupportIntegrationTest.groovy b/src/test/groovy/graphql/execution/incremental/DeferExecutionSupportIntegrationTest.groovy index c57945aae4..8aec991043 100644 --- a/src/test/groovy/graphql/execution/incremental/DeferExecutionSupportIntegrationTest.groovy +++ b/src/test/groovy/graphql/execution/incremental/DeferExecutionSupportIntegrationTest.groovy @@ -1633,6 +1633,47 @@ class DeferExecutionSupportIntegrationTest extends Specification { !(result instanceof IncrementalExecutionResult) + } + + def "two fragments one same type"() { + given: + def query = ''' + query { + post { + id + ...f1 + ...f2 @defer + } + } + + fragment f1 on Post { + text + } + fragment f2 on Post { + summary + } + ''' + when: + def initialResult = executeQuery(query) + + then: + initialResult.toSpecification() == [ + data : [post: [id: "1001", text: "The full text"]], + hasNext: true + ] + + when: + def incrementalResults = getIncrementalResults(initialResult) + + then: + // Ordering is non-deterministic, so we assert on the things we know are going to be true. + + incrementalResults.size() == 1 + incrementalResults[0] == [hasNext : false, + incremental: [[path: ["post"], data: [summary: "A summary"]]] + ] + + } From 2c838fca5803bb9710b0cb3df4667fccd9a11926 Mon Sep 17 00:00:00 2001 From: Andreas Marek Date: Thu, 15 May 2025 11:25:17 +1000 Subject: [PATCH 2/2] cleanup --- .../incremental/DeferExecutionSupportIntegrationTest.groovy | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/groovy/graphql/execution/incremental/DeferExecutionSupportIntegrationTest.groovy b/src/test/groovy/graphql/execution/incremental/DeferExecutionSupportIntegrationTest.groovy index 8aec991043..49e51eaf5a 100644 --- a/src/test/groovy/graphql/execution/incremental/DeferExecutionSupportIntegrationTest.groovy +++ b/src/test/groovy/graphql/execution/incremental/DeferExecutionSupportIntegrationTest.groovy @@ -1666,14 +1666,12 @@ class DeferExecutionSupportIntegrationTest extends Specification { def incrementalResults = getIncrementalResults(initialResult) then: - // Ordering is non-deterministic, so we assert on the things we know are going to be true. incrementalResults.size() == 1 - incrementalResults[0] == [hasNext : false, - incremental: [[path: ["post"], data: [summary: "A summary"]]] + incrementalResults[0] == [incremental: [[path: ["post"], data: [summary: "A summary"]]], + hasNext : false ] - }