Skip to content

[Fusion] Add LookupMustHaveArgumentsRule#9758

Merged
tobias-tengler merged 2 commits into
mainfrom
tte/do-not-throw-for-missing-lookup-arguments
May 21, 2026
Merged

[Fusion] Add LookupMustHaveArgumentsRule#9758
tobias-tengler merged 2 commits into
mainfrom
tte/do-not-throw-for-missing-lookup-arguments

Conversation

@tobias-tengler
Copy link
Copy Markdown
Member

No description provided.

Comment thread src/HotChocolate/Fusion/test/Fusion.Composition.Tests/SchemaComposerTests.cs Outdated
@tobias-tengler tobias-tengler marked this pull request as ready for review May 21, 2026 10:15
Copilot AI review requested due to automatic review settings May 21, 2026 10:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Fusion source-schema validation rule to ensure that fields annotated with @lookup declare at least one argument, and wires it into composition so schemas with argument-less lookups fail fast with a dedicated log entry/code.

Changes:

  • Added LookupMustHaveArgumentsRule and registered it in SchemaComposer source-schema validation rules.
  • Introduced a new log entry code + localized resource/message for the validation failure.
  • Added unit tests covering both the standalone rule behavior and end-to-end composition failure behavior.

Reviewed changes

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

Show a summary per file
File Description
src/HotChocolate/Fusion/test/Fusion.Composition.Tests/SourceSchemaValidationRules/LookupMustHaveArgumentsRuleTests.cs Adds rule-level tests for valid/invalid @lookup fields based on presence of arguments.
src/HotChocolate/Fusion/test/Fusion.Composition.Tests/SchemaComposerTests.cs Adds composition-level test asserting compose fails with the new log entry/code for argument-less lookup.
src/HotChocolate/Fusion/src/Fusion.Composition/SourceSchemaValidationRules/LookupMustHaveArgumentsRule.cs Implements the new source schema validation rule for @lookup argument presence.
src/HotChocolate/Fusion/src/Fusion.Composition/SchemaComposer.cs Registers the new rule in the source schema validation pipeline.
src/HotChocolate/Fusion/src/Fusion.Composition/Properties/CompositionResources.resx Adds localized message template for the new log entry.
src/HotChocolate/Fusion/src/Fusion.Composition/Properties/CompositionResources.Designer.cs Updates generated resource accessor for the new message key.
src/HotChocolate/Fusion/src/Fusion.Composition/Logging/LogEntryHelper.cs Adds LookupMustHaveArguments(...) log entry factory.
src/HotChocolate/Fusion/src/Fusion.Composition/Logging/LogEntryCodes.cs Adds LOOKUP_MUST_HAVE_ARGUMENTS code constant.
Files not reviewed (1)
  • src/HotChocolate/Fusion/src/Fusion.Composition/Properties/CompositionResources.Designer.cs: Language not supported

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

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.

3 participants