Skip to content

Improve GraphQL naming conflict error to identify conflicting entities and operations#3722

Draft
RubenCerna2079 with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-duplicate-graphql-operations
Draft

Improve GraphQL naming conflict error to identify conflicting entities and operations#3722
RubenCerna2079 with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-duplicate-graphql-operations

Conversation

Copilot AI commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Why make this change?

When autoentities includes tables whose names differ only by singular/plural form (e.g. dbo.Category and dbo.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: Replaced HashSet<string> operation tracking with Dictionary<string, string> (operation → owning entity). Checks all operations (not short-circuit) to collect every conflicting name, then builds a structured error message including:
    • Both conflicting entity names
    • All conflicting GraphQL operation names
    • Singular/plural type names (for table/view entities)
    • Actionable resolution instructions

Before:

Entity dbo_Category generates queries/mutation that already exist

After:

GraphQL naming conflict detected.

Entities:
  dbo_Categories
  dbo_Category

The above entities generate conflicting GraphQL operation names:
  category_by_pk
  categories
  createCategory
  updateCategory
  deleteCategory

GraphQL type names in conflict:
  Singular type: Category
  Plural type: Categories

Configure distinct GraphQL singular and plural names for one of the entities to resolve this conflict.

How was this tested?

  • Integration Tests
  • Unit Tests
    • Updated ValidateExceptionForDuplicateQueriesDueToEntityDefinitions helper to verify both conflicting entity names appear in the message
    • Updated all 6 existing duplicate-detection test call sites
    • Added ValidateAutoEntitiesWithSingularPluralNameCollisionGenerateDuplicateQueries covering the exact dbo.Category / dbo.Categories scenario

Sample Request(s)

N/A — error message improvement only; no API behavior changes.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI changed the title [WIP] Fix autoentities conflict with duplicate GraphQL operations Improve GraphQL naming conflict error to identify conflicting entities and operations Jul 14, 2026
Copilot AI requested a review from RubenCerna2079 July 14, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Known Issue]: Autoentities fail when table names generate duplicate GraphQL operations

2 participants