Skip to content

[Fusion] Fix introspection argument list misalignment - #10024

Merged
glen-84 merged 2 commits into
mainfrom
gai/introspection-argument-misalignment
Jul 1, 2026
Merged

[Fusion] Fix introspection argument list misalignment#10024
glen-84 merged 2 commits into
mainfrom
gai/introspection-argument-misalignment

Conversation

@glen-84

@glen-84 glen-84 commented Jul 1, 2026

Copy link
Copy Markdown
Member

Summary

  • The gateway introspection resolvers __Field.args and __Directive.args sized their result list to the non-deprecated argument count but iterated the list slots while indexing the full argument list, skipping deprecated arguments with continue. A deprecated argument that was not last left an unfilled list slot, which surfaced as an "Unexpected Execution Error" and dropped a trailing argument.
  • Both resolvers now iterate the source arguments and advance the list enumerator only for the arguments they include, matching the existing enumValues and inputFields resolvers.

Test plan

  • New gateway introspection test: a field whose first argument is deprecated and second is not; __type.fields.args returns only the non-deprecated argument (previously errored).
  • Full Fusion.Execution.Tests suite passes.

Copilot AI review requested due to automatic review settings July 1, 2026 09:00

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

Fixes a gateway introspection bug where __Field.args / __Directive.args could leave gaps in the produced list when deprecated arguments were skipped, causing an execution error and dropping subsequent arguments.

Changes:

  • Update __Field.Arguments and __Directive.Arguments to iterate source arguments and advance the result-list enumerator only for included entries (avoids index/list-slot misalignment).
  • Add a regression test covering the “deprecated arg first, non-deprecated arg second” scenario via gateway introspection.

Reviewed changes

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

File Description
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Execution/Introspection/FieldArgumentsIntrospectionTests.cs Adds regression coverage ensuring deprecated args are excluded without producing list gaps/errors.
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Introspection/__Field.cs Fixes __Field.args list materialization to avoid gaps when skipping deprecated args.
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Introspection/__Directive.cs Fixes __Directive.args list materialization to avoid gaps when skipping deprecated args.

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

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Patch coverage

57.1% of changed lines covered (8/14)

File Covered Changed Patch %
…/src/Fusion.Execution/Execution/Introspection/__Directive.cs 4 7 57.1% 🔴
…/src/Fusion.Execution/Execution/Introspection/__Field.cs 4 7 57.1% 🔴
Uncovered changed lines (JSON)
{
  "sha": "4611aa28ac1a11e3ab333b36cbe967d024e834c3",
  "files": [
    { "path": "src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Introspection/__Directive.cs", "ranges": [[167, 169]] },
    { "path": "src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Introspection/__Field.cs", "ranges": [[90, 92]] }
  ]
}

Project coverage: 52.5% (216951/413145 lines)

@glen-84
glen-84 merged commit e14930b into main Jul 1, 2026
146 checks passed
@glen-84
glen-84 deleted the gai/introspection-argument-misalignment branch July 1, 2026 09:21
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.

2 participants