[Fusion] Add LookupMustHaveArgumentsRule#9758
Merged
tobias-tengler merged 2 commits intoMay 21, 2026
Merged
Conversation
glen-84
reviewed
May 21, 2026
Contributor
There was a problem hiding this comment.
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
LookupMustHaveArgumentsRuleand registered it inSchemaComposersource-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.
This was referenced May 21, 2026
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.