graphql-engine icon indicating copy to clipboard operation
graphql-engine copied to clipboard

Collisions in collection names across different connectors are not handled gracefully

Open codingkarthik opened this issue 1 year ago • 0 comments

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

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

gql_root_field_collisions

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

codingkarthik avatar Jul 15 '24 12:07 codingkarthik