graphql-engine: Unable to create array relationships from array of IDs
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).

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.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 18
- Comments: 15 (2 by maintainers)
Commits related to this issue
- Merge pull request #6845 from hasura/manas/NDAT-320-2-15-backport (2.15 backport) console: refactored browse rows to refetch on every table name change GitOrigin-RevId: dff7dfe9dae2855631c3f55744c6d... — committed to hasura/graphql-engine by manasag 2 years ago
- Merge pull request #6845 from hasura/manas/NDAT-320-2-15-backport (2.15 backport) console: refactored browse rows to refetch on every table name change GitOrigin-RevId: dff7dfe9dae2855631c3f55744c6d... — committed to hasura/graphql-engine by manasag 2 years ago
- Merge pull request #6845 from hasura/manas/NDAT-320-2-15-backport (2.15 backport) console: refactored browse rows to refetch on every table name change GitOrigin-RevId: dff7dfe9dae2855631c3f55744c6d... — committed to hasura/graphql-engine by manasag 2 years ago
- Merge pull request #6845 from hasura/manas/NDAT-320-2-15-backport (2.15 backport) console: refactored browse rows to refetch on every table name change GitOrigin-RevId: dff7dfe9dae2855631c3f55744c6d... — committed to hasura/graphql-engine by manasag 2 years ago
Agree, we need this functionality too… any news on this?
We have the same requirement here but it’s on the output type of an action, we return a field called:
affected_activities_ids: [Int!]and then on Hasura we want to create a relationship from this array to the actual activity table so the client can get the actual activity objects and not just the IDs.Using a many-to-many table here doesn’t work because the data is mutable, not persisted… it’s calculated at runtime.
Also running into the same issue. We have a bulk action that does many different things, and we would like to be able to return these as something like
There are ids of the items that changed. We’d like to be able to link those to ‘post’. So that we can then get the data for all the created posts, updated posts, and deleted posts.
The reason we cant return them in a single array such as
[18, 19, 20, 2, 7, 1, 8, 9]. Is because A) Some items have been deleted, and we now need to delete them from the frontend B) We handle the create and updated changes differently and need to know what is new, and what updated.Thanks for the intention to assist. I’m aware of using an intermediate table to establish this relationship but this is not how I’m intending to structure my data. Unfortunately it seems like Hasura does not fulfill my requirements currently.
Any updates to this? Also would like to do similar attachment logic without extra tables.