hasura / hasura/graphql-engine

Can I use a UUID[] of foreign keys as a relationship?

Open
#3,882 4 comments 9 reactions 0 assignees View on GitHub
k/question
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

I don't expect this to work, but wondered if there was some way that Hasura could handle an array of foreign keys to manage a one-to-many relationship.

In my example, I have a series of UUIDs stored in an array that correspond to primary keys in another table. I'd love to navigate them as edges, but alas:

```
"error": {
"exec_status": "FatalError",
"hint": "No operator matches the given name and argument types. You might need to add explicit type casts.",
"message": "operator does not exist: uuid[] = uuid",
"status_code": "42883",
"description":
},
```

Contributor guide

Open the contributing guide

Research direction

No repository files or tests are named. Start with the UUID[] example and the reported PostgreSQL `uuid[] = uuid` error, then determine whether array foreign keys can be exposed as relationship edges. Done would require an agreed answer or implementation scope, plus coverage for the supported behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, postgres
Domain
api, database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.