Fix source-gen resolvers dropping custom parameter expression builders - #10041
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds coverage and runtime support so source-generated resolvers honor AddParameterExpressionBuilder(...) injections (instead of turning those parameters into GraphQL field arguments), while keeping the “no custom builder registered” behavior intact.
Changes:
- Introduces a new integration-test mutation (
createExport) and aCurrentUserCLR type to validate custom parameter injection vs. implicit argument inference. - Adds integration tests that assert the parameter is not exposed as a GraphQL argument and that the injected value is actually used at execution time.
- Updates
CustomParameterExpressionBuilder<TArg>to participate in the source-gen parameter binding pipeline (IParameterBindingFactory/IParameterBinding).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/HotChocolate/Core/test/Types.Analyzers.Integration.Tests/Types.cs | Adds createExport mutation and CurrentUser type used to validate custom parameter injection behavior. |
| src/HotChocolate/Core/test/Types.Analyzers.Integration.Tests/ParameterExpressionBuilderTests.cs | New tests ensuring source-generated resolver binding uses the registered custom parameter expression builder. |
| src/HotChocolate/Core/test/Types.Analyzers.Integration.Tests/snapshots/IntegrationTests.Schema_Snapshot.snap | Updates schema snapshot to include createExport and inferred CurrentUserInput when no custom builder is registered. |
| src/HotChocolate/Core/test/Types.Analyzers.Integration.Tests/snapshots/IntegrationTests.Schema_Snapshot_Without_ConnectionName_Inference.snap | Same schema snapshot update for the “no connection name inference” configuration. |
| src/HotChocolate/Core/src/Types/Internal/CustomParameterExpressionBuilder.cs | Implements binding factory/binding so source-gen can resolve parameters via custom expression builders. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Patch coverage98.2% of changed lines covered (162/165)
Uncovered changed lines (JSON){
"sha": "487fc72eeda8586fb5492aaf1aada68b33bc3f58",
"files": [
{ "path": "src/HotChocolate/Core/src/Types/Internal/CustomParameterExpressionBuilder.cs", "ranges": [[67, 67]] },
{ "path": "src/HotChocolate/Core/src/Types.Analyzers/FileBuilders/TypeFileBuilderBase.cs", "ranges": [[1481, 1482]] }
]
}Project coverage: 53.4% (227473/426263 lines) |
This was referenced Jul 13, 2026
This was referenced Jul 19, 2026
This was referenced Jul 26, 2026
chore(deps): Bump HotChocolate.Subscriptions.InMemory from 15.1.14 to 16.5.1
Kuestenlogik/Bowire#506
Merged
This was referenced Aug 3, 2026
This was referenced Aug 11, 2026
Open
Open
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.