From caed255f0c0483a367bcaaf4303bd263b00dddc8 Mon Sep 17 00:00:00 2001 From: Glen Date: Mon, 18 May 2026 10:25:49 +0200 Subject: [PATCH] Fix AllowNonPersistedOperation to preserve existing override fields The extension previously contained a no-op if/else where both branches allocated a fresh PersistedOperationRequestOverrides, discarding any existing override state. Replace with a branch that constructs a new record when none exists and uses `with` to flip the flag otherwise. --- .../Features/PersistedOperationRequestOverridesExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HotChocolate/Core/src/Execution.Abstractions/Execution/Features/PersistedOperationRequestOverridesExtensions.cs b/src/HotChocolate/Core/src/Execution.Abstractions/Execution/Features/PersistedOperationRequestOverridesExtensions.cs index 5e7f333b339..52bec25b8ac 100644 --- a/src/HotChocolate/Core/src/Execution.Abstractions/Execution/Features/PersistedOperationRequestOverridesExtensions.cs +++ b/src/HotChocolate/Core/src/Execution.Abstractions/Execution/Features/PersistedOperationRequestOverridesExtensions.cs @@ -27,7 +27,7 @@ public static OperationRequestBuilder AllowNonPersistedOperation( } else { - options = new PersistedOperationRequestOverrides(AllowNonPersistedOperation: true); + options = options with { AllowNonPersistedOperation = true }; } builder.Features.Set(options);