graphql-engine
graphql-engine copied to clipboard
Collisions in collection names across different connectors are not handled gracefully
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?
- Create a subgraph
- Add a postgres connector that connects to the chinook db
- Add a SQL server connector that connectors to the chinook db
- Create a supergraph build.