hasura / hasura/graphql-engine

v3-cli: connector-link overwrite if there is a model/command with the same name

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

Description

### Component

### What is the current behaviour?
When you have an model name users , you create an connector-link name called users, so after the connector-link update users.hml gets override

### What is the expected behaviour?

### How to reproduce the issue?

1. `ddn connector-link add users --subgraph bug_bounty/subgraph.yaml --configure-host "http://local.hasura.dev:8085" --target-env-file="bug_bounty/.env.bug_bounty.local"`
2. `ddn connector-link update users --subgraph bug_bounty/subgraph.yaml --env-file bug_bounty/.env.bug_bounty.local --add-all-resources`

### Screenshots or Screencast

### Please provide any traces or logs that could help here.
ddn supergraph build will fail
`
3:55PM ERR Code=opendds-validation Message="invalid metadata: error building schema: invalid metadata: data connector users (in subgraph bug_bounty) referenced in type mappings of type CartItems (in subgraph bug_bounty) is not found in object type CartItems (in subgraph bug_bounty)"
`

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

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the two `ddn connector-link` commands in the v3-cli component with a model and connector-link sharing the name `users`. Trace which generated file is overwritten during `connector-link update`, then verify that the model remains intact and `ddn supergraph build` succeeds without the reported metadata error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.