hasura / hasura/graphql-engine

Collisions in collection names across different connectors are not handled gracefully

Open
#10,410 0 comments 0 reactions 0 assignees View on GitHub
c/v3-cli k/v3-bug
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Component

### What is the current behaviour?

I tried to add the chinook database using the postgres and the MSSQL connector. I had first added the postgres connector and then I added the MSSQL connector, the collisions currently are basically adding a suffix like `_1` at the end of every collection's `hml` file. Attaching image for reference:

![duplicate_hml_files](https://github.com/user-attachments/assets/6bc63be7-30ef-4183-a15b-507c10eb1e58)

Due to the above, the GraphQL root fields that are generated look like the following:

![gql_root_field_collisions](https://github.com/user-attachments/assets/b29b81b9-ac51-4dfd-bc7c-6e7f4c95ddd9)

### What is the expected behaviour?

One idea I can think of solving this issue is to add the connector name to be the discriminant:

For example, the root field names can be:

`sqlSubgraph_Artist` and `sqlSubgraph_my_mssql_Artist`

or if we detect a collision while linking the connector, we can present the user with various conflict resolution strategies and then they can choose how they want to resolve with the conflicts.

### How to reproduce the issue?

1. Create a subgraph
2. Add a postgres connector that connects to the chinook db
3. Add a SQL server connector that connectors to the chinook db
4. Create a supergraph build.

### Screenshots or Screencast

### Please provide any traces or logs that could help here.

### Any possible solutions/workarounds you're aware of?

### Keywords

Contributor guide

Open the contributing guide

Research direction

Reproduce the collision by adding the Chinook database through PostgreSQL and SQL Server connectors, then build the supergraph. Inspect the generated .hml collection names and GraphQL root fields; done means collisions are handled without ambiguous or mechanically suffixed names, with the chosen resolution reflected consistently in the generated schema.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, postgresql
Domain
api, backend-api-design, databases
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.