Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix internal projection selections leaking into the response - #9978

#9978
Merged
michaelstaib merged 2 commits into
mainChilliCream/graphql-platform:mainfrom
mst/issue_9939ChilliCream/graphql-platform:mst/issue_9939Copy head branch name to clipboard
Jun 24, 2026
Merged

Fix internal projection selections leaking into the response#9978
michaelstaib merged 2 commits into
mainChilliCream/graphql-platform:mainfrom
mst/issue_9939ChilliCream/graphql-platform:mst/issue_9939Copy head branch name to clipboard

Conversation

@michaelstaib

@michaelstaib michaelstaib commented Jun 24, 2026

Copy link
Copy Markdown
Member

Fixes #9939

Copilot AI review requested due to automatic review settings June 24, 2026 06:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 addresses a correctness issue where execution-engine-internal projection selections (for example _combinedSelectionSet, __projection_alias_N) could leak into the client-facing response via null-propagation and/or surfaced errors. It ensures internal selections are treated as fully internal across their subtrees and that their errors and nulls are contained.

Changes:

  • Propagate “internal” status down the selection subtree during operation compilation so nested selections under an internal selection are also internal.
  • Treat internal result elements as nullable to prevent null-propagation from internal selections affecting the client response, and suppress reporting errors for internal selections.
  • Add regression tests for projection + authorization interactions and update related snapshots; add required test project reference.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/HotChocolate/Data/test/Data.Tests/ProjectionAuthorizationTests.cs Adds regression tests ensuring internal projection selections neither surface data nor errors unless explicitly selected by the client.
src/HotChocolate/Data/test/Data.Tests/HotChocolate.Data.Tests.csproj Adds a project reference needed for authorization types used in the new tests.
src/HotChocolate/Core/test/Execution.Tests/Processing/snapshots/OperationCompilerTests.Field_Based_Optimizers.snap Updates snapshot to reflect internal propagation changes in compiled operations.
src/HotChocolate/Core/src/Types/Text/Json/ResultElement.cs Treats internal selections as nullable to contain null/error propagation.
src/HotChocolate/Core/src/Types/Execution/Processing/OperationCompiler.cs Ensures “internal” status is inherited by nested selections during compilation.
src/HotChocolate/Core/src/Types/Execution/Processing/MiddlewareContext.Global.cs Suppresses client-facing error reporting for internal selections to prevent leakage.

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

@github-code-quality

Copy link
Copy Markdown

Code Coverage Overview

Languages: C#

C# / code-coverage/dotnet

The overall coverage in the mst/issue_9939 branch remains at 49%, unchanged from the main branch.

Show a code coverage summary of the most impacted files.
File main 303ba5f mst/issue_9939 de4c8de +/-
/home/runner/wo...ageProcessor.cs 100% 89% -11%
/home/runner/wo...entsListener.cs 66% 62% -4%
/home/runner/wo...PromiseCache.cs 81% 78% -3%
/home/runner/wo...ueryExecutor.cs 67% 65% -2%
/home/runner/wo...tor/Mediator.cs 91% 89% -2%
/home/runner/wo...sultDocument.cs 91% 92% +1%
/home/runner/wo...tionCompiler.cs 92% 93% +1%
/home/runner/wo...cutorManager.cs 94% 95% +1%
/home/runner/wo...eiveEndpoint.cs 69% 72% +3%
/home/runner/wo...ewareFactory.cs 95% 100% +5%

Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@michaelstaib
michaelstaib merged commit c03bd45 into main Jun 24, 2026
144 checks passed
@michaelstaib
michaelstaib deleted the mst/issue_9939 branch June 24, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Internal projection selections trigger authorization and leak into error paths

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.