Improve GraphQL naming conflict error to identify conflicting entities and operations - #3722
Improve GraphQL naming conflict error to identify conflicting entities and operations#3722RubenCerna2079 with Copilot wants to merge 8 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
@copilot Change the PR so that in the output message we don't include the operation names. Also, if possible we want to keep using the hashset we already used before. Try to change the logic as little as possible from what it was before the changes you made in this PR. The only change should be the error message. |
… names, remove ops from message
Done in 3a1f2d0. The changes are now minimal:
New message format: |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run |
|
Azure Pipelines: Successfully started running 6 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
Improves configuration-time GraphQL naming conflict diagnostics by augmenting RuntimeConfigValidator.ValidateEntitiesDoNotGenerateDuplicateQueriesOrMutation to track which entity “owns” each generated GraphQL operation name and by updating unit tests to validate the richer error output (including a new unit test for singular/plural auto-entity collisions).
Changes:
- Enhanced duplicate GraphQL operation detection to retain the owning entity per operation and emit a more structured conflict message.
- Updated existing unit tests to assert the new message shape (prefix + both entity names).
- Added a unit test covering
dbo.Categoryvsdbo.Categories(singular/plural collision) behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Core/Configurations/RuntimeConfigValidator.cs | Tracks operation ownership and builds a more detailed GraphQL naming conflict exception message. |
| src/Service.Tests/UnitTests/ConfigValidationUnitTests.cs | Updates duplicate-detection assertions and adds a new unit test for singular/plural auto-entity collisions. |
…te-graphql-operations' into copilot/fix-duplicate-graphql-operations
|
/azp run |
|
Azure Pipelines: Successfully started running 6 pipeline(s). |
Why make this change?
When
autoentitiesincludes tables whose names differ only by singular/plural form (e.g.dbo.Categoryanddbo.Categories), DAB fails startup with a vague error that doesn't identify the other conflicting entity, the generated GraphQL names, or how to resolve the conflict.What is this change?
RuntimeConfigValidator.ValidateEntitiesDoNotGenerateDuplicateQueriesOrMutation: ReplacedHashSet<string>operation tracking withDictionary<string, string>(operation → owning entity). Checks all operations (not short-circuit) to collect every conflicting name, then builds a structured error message including:Before:
After:
How was this tested?
ValidateExceptionForDuplicateQueriesDueToEntityDefinitionshelper to verify both conflicting entity names appear in the messageValidateAutoEntitiesWithSingularPluralNameCollisionGenerateDuplicateQueriescovering the exactdbo.Category/dbo.CategoriesscenarioSample Request(s)
N/A — error message improvement only; no API behavior changes.