Skip to content

Fix source-gen resolvers dropping custom parameter expression builders - #10041

Merged
michaelstaib merged 10 commits into
mainfrom
mst/fix-slack-issue
Jul 10, 2026
Merged

Fix source-gen resolvers dropping custom parameter expression builders#10041
michaelstaib merged 10 commits into
mainfrom
mst/fix-slack-issue

Conversation

@michaelstaib

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings July 2, 2026 20:51

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

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 a CurrentUser CLR 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.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Patch coverage

98.2% of changed lines covered (162/165)

File Covered Changed Patch %
…/Core/src/Types/Internal/CustomParameterExpressionBuilder.cs 28 29 96.6% 🟡
…/Core/src/Types.Analyzers/FileBuilders/TypeFileBuilderBase.cs 117 119 98.3% 🟡
…/Core/src/Types/Resolvers/ParameterBindingResolver.cs 17 17 100.0% 🟢
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)

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

Copilot reviewed 96 out of 96 changed files in this pull request and generated 1 comment.

@github-actions github-actions Bot added the 📚 documentation This issue is about working on our documentation. label Jul 10, 2026
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