hasura / hasura/graphql-engine

Custom tables names should be used when tracking relationships

Open
#8,165 2 comments 2 reactions 0 assignees View on GitHub
c/console estimate/S k/enhancement support/needs-action
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Version Information

Server Version: 2.1.1

### Environment

OSS

### What is the expected behaviour?

Custom table names should be used when tracking (new) relationships.

### What is the current behaviour?

Custom table names are NOT suggested when tracking a new relationship. The original/underlying table name is used instead. This makes the "track all relationships" button completely useless to me.

### How to reproduce the issue?

1. Create tables `a` and `b`, with `b` having a foreign key to `a`
2. use custom names `my_a` and `my_b`
3. track relationships, the original names will be used instead of the custom names (but this can be edited)
4. clicking "track all" won't allow modifying the name

### Screenshots or Screencast

1. table definitions
![image](https://user-images.githubusercontent.com/11539524/153258575-a062b466-42ff-45df-8cef-94b3036c434b.png)
![image](https://user-images.githubusercontent.com/11539524/153258827-5d3085ed-d454-4d8e-ae98-60f1b0c89257.png)
![image](https://user-images.githubusercontent.com/11539524/153258623-ba319850-8d0a-42b9-aefb-89106a6e5b25.png)
![image](https://user-images.githubusercontent.com/11539524/153258875-9b69966c-860a-47ff-9b9d-682cdb0dae15.png)

2. table relationships (expecting my_bs and my_a)
![image](https://user-images.githubusercontent.com/11539524/153259104-54df7b71-7e03-493e-9ba3-f317262f951c.png)
![image](https://user-images.githubusercontent.com/11539524/153259036-86c68139-1c34-468a-ac93-6d2adb1d9196.png)

3. schema relationships
![image](https://user-images.githubusercontent.com/11539524/153259531-900398a3-639a-408b-aa34-2e4b9de8d2ec.png)

Contributor guide

Open the contributing guide

Research direction

Start from the “track all relationships” entry point and the relationship-tracking flow described in the reproduction steps. Reproduce the case with custom names `my_a` and `my_b`, then trace where suggested relationship names are generated from the underlying foreign-key tables. Done means both individual tracking and “track all” use the custom names.

Written by the indexing model from the issue text.

Assessment

Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.