Repository navigation
Fix Unexpected Execution Error when entity lookup returns null - #9991
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a Fusion execution edge case where an entity lookup returning null could surface an “Unexpected Execution Error”, by treating a clean null lookup result as a valid “not found” state and completing fields using normal GraphQL nullability semantics.
Changes:
- Update result completion to handle a
nullsource without an associated error by completing each selected field (triggering standard non-null violations where applicable) rather than emitting a generic execution error. - Add coverage for nested entity lookups that resolve to
null, including both non-null and nullable parent-field scenarios, with new snapshots. - (Unrelated / problematic) Add external worktree project references to
src/All.slnxthat appear to be machine-local paths.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/LookupTests.cs | Adds new lookup tests covering entity lookup returning null for nested entities. |
| src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/snapshots/LookupTests.Lookup_Should_Return_Null_When_Nested_Entity_Not_Found.yaml | Snapshot for the non-null parent-field case (expects non-null violation instead of unexpected execution error). |
| src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/snapshots/LookupTests.Lookup_Should_Null_Field_When_Nullable_Entity_Not_Found.yaml | Snapshot for the nullable parent-field case (field nulling + error semantics captured). |
| src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Results/ValueCompletion.cs | Implements per-field completion behavior for clean null sources without errors. |
| src/All.slnx | Adds machine-local ../.claude/worktrees/... projects (should be removed). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+463
to
+479
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/examples/PostgresTransport/PostgresTransport.AppHost/PostgresTransport.AppHost.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/examples/PostgresTransport/PostgresTransport.Contracts/PostgresTransport.Contracts.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/examples/PostgresTransport/PostgresTransport.NotificationService/PostgresTransport.NotificationService.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/examples/PostgresTransport/PostgresTransport.OrderService/PostgresTransport.OrderService.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/examples/PostgresTransport/PostgresTransport.ServiceDefaults/PostgresTransport.ServiceDefaults.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/examples/PostgresTransport/PostgresTransport.ShippingService/PostgresTransport.ShippingService.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/src/Examples/MediatorShowcase/MediatorShowcase.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/src/Examples/Middleware/UnitOfWork/UnitOfWork.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/src/Examples/Observability/OpenTelemetry/OpenTelemetryExample.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/src/Examples/Reliability/CircuitBreaker/CircuitBreaker.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/src/Examples/Reliability/OutboxInbox/OutboxInbox.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/src/Examples/Transports/MultiTransport/MultiTransport.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/src/Examples/Transports/RabbitMQ/RabbitMQ.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/src/Mocha.Abstractions/Mocha.Abstractions.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/src/Mocha.Analyzers/Mocha.Analyzers.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/src/Mocha.EntityFrameworkCore.Postgres/Mocha.EntityFrameworkCore.Postgres.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/src/Mocha.EntityFrameworkCore/Mocha.EntityFrameworkCore.csproj" /> |
Comment on lines
+480
to
+494
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/src/Mocha.Hosting/Mocha.Hosting.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/src/Mocha.Inbox/Mocha.Inbox.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/src/Mocha.Mediator.Abstractions/Mocha.Mediator.Abstractions.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/src/Mocha.Mediator/Mocha.Mediator.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/src/Mocha.Outbox/Mocha.Outbox.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/src/Mocha.Threading/Mocha.Threading.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/src/Mocha.Transport.InMemory/Mocha.Transport.InMemory.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/src/Mocha.Transport.Postgres/Mocha.Transport.Postgres.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/src/Mocha.Transport.RabbitMQ/Mocha.Transport.RabbitMQ.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/src/Mocha.Utilities/Mocha.Utilities.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/src/Mocha/src/Mocha/Mocha.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/templates/azure-function/HotChocolate.Template.AzureFunctions.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/templates/gateway/HotChocolate.Template.Gateway.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/templates/HotChocolate.Templates.csproj" /> | ||
| <Project Path="../.claude/worktrees/agent-a89bf9078d0222525/templates/server/HotChocolate.Template.Server.csproj" /> |
Comment on lines
+145
to
+146
| [Fact] | ||
| public async Task Lookup_Should_Return_Null_When_Nested_Entity_Not_Found() |
Comment on lines
+186
to
+188
| [Fact] | ||
| public async Task Lookup_Should_Null_Field_When_Nullable_Entity_Not_Found() | ||
| { |
Contributor
Patch coverage30.7% of changed lines covered (31/101)
Uncovered changed lines (JSON){
"sha": "552f55c9817ae7034fb337ce6caebc2f3083afa8",
"files": [
{ "path": "src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/LookupTests.cs", "ranges": [[147, 147], [149, 151], [153, 155], [157, 161], [164, 164], [166, 175], [177, 180], [183, 184], [188, 188], [190, 192], [194, 196], [198, 202], [205, 205], [207, 216], [218, 221], [224, 225], [366, 366], [369, 369], [374, 374], [380, 380], [387, 387], [402, 402], [405, 405], [410, 410], [416, 416], [423, 423]] },
{ "path": "src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Results/ValueCompletion.cs", "ranges": [[350, 351]] }
]
}Project coverage: 49.3% (217292/440360 lines) |
This was referenced Jul 7, 2026
This was referenced Jul 14, 2026
This was referenced Jul 23, 2026
This was referenced Sep 1, 2026
Closed
This was referenced Sep 15, 2026
Closed
[nuget][SUI_Matcher]- Bump the sui-package-updates group with 20 updates
DFE-Digital/SUI_Matcher#405
Closed
This was referenced Sep 22, 2026
Closed
Closed
[nuget][SUI_Matcher]- Bump the sui-package-updates group with 20 updates
DFE-Digital/SUI_Matcher#410
Merged
This was referenced Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.