Skip to content

Move DefaultErrorHandlingMode to request options and add AllowErrorHandlingModeOverride#9634

Merged
tobias-tengler merged 2 commits intomainfrom
tte/disable-onerror-override-by-default
May 2, 2026
Merged

Move DefaultErrorHandlingMode to request options and add AllowErrorHandlingModeOverride#9634
tobias-tengler merged 2 commits intomainfrom
tte/disable-onerror-override-by-default

Conversation

@tobias-tengler
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings May 2, 2026 16:11
@github-actions github-actions Bot added 📚 documentation This issue is about working on our documentation. 🌶️ hot chocolate labels May 2, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR relocates null-propagation error handling defaults from schema/gateway options into request-level executor options, and introduces an explicit AllowErrorHandlingModeOverride switch to control whether per-request onError values are honored. It updates both Core and Fusion execution paths, plus related tests and migration guidance.

Changes:

  • Move DefaultErrorHandlingMode from schema/Fusion core options into RequestExecutorOptions and FusionRequestOptions.
  • Gate per-request onError overrides behind the new AllowErrorHandlingModeOverride setting in Core and Fusion execution.
  • Update tests, snapshots, and migration docs to reflect the new configuration surface.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
website/src/docs/hotchocolate/v16/migrating/migrate-from-15-to-16.md Updates migration guidance to configure the default mode via request options.
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/SourceSchemaErrorTests.cs Adjusts Fusion integration test setup to use request options for default error handling.
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/FusionRequestOptions.cs Adds Fusion request-level default error handling settings and clone support.
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/FusionOptions.cs Removes default error handling from Fusion schema-level options.
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Extensions/FusionRequestContextExtensions.cs Switches Fusion runtime fallback logic to request options.
src/HotChocolate/Core/test/Execution.Tests/Errors/__snapshots__/NullErrorPropagationTests.PerRequestOverride_IsIgnored_When_AllowErrorHandlingModeOverride_IsDisabled.json Adds expected Core snapshot for disabled per-request override behavior.
src/HotChocolate/Core/test/Execution.Tests/Errors/__snapshots__/NullErrorPropagationTests.DefaultErrorHandlingMode_AppliesFromRequestExecutorOptions.json Adds expected Core snapshot for request-executor default mode behavior.
src/HotChocolate/Core/test/Execution.Tests/Errors/NullErrorPropagationTests.cs Renames and extends Core tests for request-executor defaults and override gating.
src/HotChocolate/Core/src/Types/SchemaOptions.cs Removes schema-level storage/copying of DefaultErrorHandlingMode.
src/HotChocolate/Core/src/Types/IReadOnlySchemaOptions.cs Removes the schema-options API surface for default error handling mode.
src/HotChocolate/Core/src/Types/Execution/Processing/OperationContext.Pooling.cs Reads null-propagation behavior from executor request options during operation initialization.
src/HotChocolate/Core/src/Types/Execution/Options/RequestExecutorOptions.cs Adds request-executor-level default mode and override toggle.
src/HotChocolate/Core/src/Types/Execution/Options/IErrorHandlerOptionsAccessor.cs Exposes the new error handling settings through the options accessor interface.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/HotChocolate/Fusion/src/Fusion.Execution/Execution/FusionRequestOptions.cs Outdated
Comment thread src/HotChocolate/Core/test/Execution.Tests/Errors/NullErrorPropagationTests.cs Outdated
@tobias-tengler tobias-tengler merged commit 62e1652 into main May 2, 2026
138 of 139 checks passed
@tobias-tengler tobias-tengler deleted the tte/disable-onerror-override-by-default branch May 2, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📚 documentation This issue is about working on our documentation. 🌶️ hot chocolate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants