hasura / hasura/graphql-engine

Improve error message if a connector with duplicate name is added to the same subgraph

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

Description

### Component

### What is the current behaviour?

```sh
✦ ❯ ddn connector init my_pg --subgraph sql_subgraph/subgraph.yaml --hub-connector hasura/sqlserver --configure-port 8085 --add-to-compose-file compose.yaml
5:30PM INF Checking for update...
5:30PM INF ddn cli is up to date version={"CLI":"v1.0.0","CLISemver":"1.0.0"}
5:30PM ERR Failed: directory "sql_subgraph/connector/my_pg" is not empty
```
Users might misunderstand this error and just remove the `my_pg` folder 😅 to make the command work.

### What is the expected behaviour?

Throw an error message something like:

```
Connector named `my_pg` already exists in the subgraph `sql_subgraph`
```

### How to reproduce the issue?

1.
2.
3.

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

Start by reproducing the `ddn connector init my_pg --subgraph sql_subgraph/subgraph.yaml` command and trace the CLI entry point that reports `directory ... is not empty`. Confirm that the duplicate connector name is detected before directory creation, and that the final error identifies the connector and subgraph instead of suggesting only a non-empty directory.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.