hasura / hasura/graphql-engine

Enum dropdown not showing if they are in a different schema

Open
#9,004 3 comments 0 reactions 0 assignees View on GitHub
c/console estimate/M k/bug
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Version Information

Server Version:
CLI Version (for CLI related issue): v2.12.0

### Environment

docker/self-hosted

### What is the current behaviour?

'locale' table is setup as enum in Schema named 'enum':
![image](https://user-images.githubusercontent.com/72418976/192188717-6c17159e-be33-454b-b1ff-1226c329dacb.png)

Definition of 'locale':
![image](https://user-images.githubusercontent.com/72418976/192188980-39bbf373-2325-41a6-af85-06ea42bee2df.png)

In another Schema 'public', it shows it as text for all tables:
![image](https://user-images.githubusercontent.com/72418976/192189201-6b9dc0b9-7362-4e50-9c21-c0be61267154.png)
![image](https://user-images.githubusercontent.com/72418976/192189242-9fee0945-db13-4fe2-a0de-c8dec2f6f493.png)

This is the case for all enums.

### What is the expected behaviour?

![image](https://user-images.githubusercontent.com/72418976/192189777-93a63a43-a8d1-4332-9c60-75f0c57ad275.png)

It should be a drop down instead of a text field.

The issue is because they are not in the same schema.

In above screenshot, it worked correctly because I put the enum in the same schema.

### How to reproduce the issue?

1. define an enum in a new schema
2. foreign key it from a table in another schema

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue in the table editor by defining an enum in one schema and referencing it from a table in another, then compare it with an enum in the same schema. Trace how the editor identifies enum columns across schemas; done means the cross-schema enum is rendered as a dropdown rather than a text field.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, typescript
Domain
database, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.