hasura / hasura/graphql-engine

Unable to create array relationships from array of IDs

Open
#6,845 16 comments 18 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

I have a table 'post' with the column 'media_ids'. I'm trying to create an array relationship to the 'media' table on it's 'id' column.
In Hasura, it seems that this is impossible although I see a similar issue from a while ago that was closed (https://github.com/hasura/graphql-engine/issues/4464).

![tAT2jJ](https://user-images.githubusercontent.com/30897811/116472081-57085e80-a86d-11eb-985f-5f5f161b5a44.png)

When querying after creating this relationship, an error is produced:
`"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: bigint[] = bigint", "status_code": "42883", "description": null },`

Is there any solution to this? I've created a computed field to retrieve the media rows from the media_ids column, but now there is no way to do a nested insert for medias when inserting a post.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.