hasura / hasura/graphql-engine
Collisions in collection names across different connectors are not handled gracefully
- 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:

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

### 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
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