hasura / hasura/graphql-engine

Expose remote_table option in Native Queries Relationships UI

Open
#10,156 0 comments 0 reactions 0 assignees View on GitHub
k/enhancement
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

Reading [the native queries docs ](https://hasura.io/docs/latest/schema/postgres/native-queries/#relationships-with-tables), at the part of relationships with table it shows the ability to map a table to a logical model's column via the remote_table option:

```json
{
"type": "pg_track_native_query",
"args": {
"arguments": {},
"array_relationships": [],
"code": "SELECT * FROM (VALUES (1, 'Logical Models', 1), (2, 'Native Queries', 2), (3, 'Relationships', 3), (4, 'Graph Relationships', 4), (5, 'Permissions', 5)) as t(\"id\", \"title\", \"author_id\")",
"object_relationships": [
{
"name": "author",
"using": {
"column_mapping": {
"author_id": "id"
},
"insertion_order": null,
"remote_table": "authors" <------ HERE
}
}
],
"returns": "article",
"root_field_name": "get_articles",
"source": "default",
"type": "query"
}
}
```

this option is missing on the UI

![image](https://github.com/hasura/graphql-engine/assets/8311776/85cabb8a-accb-441e-913b-b3e2abeac93e)

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the native queries documentation section on relationships with tables and the existing Native Queries Relationships UI shown in the issue. Trace how relationship options are represented and rendered, then expose the remote_table option so it can map a logical model column to a table as described. Done means the option is available in the UI and produces the documented configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.