IssueRaiser

update nested object

First, thank you very much for your work on Hasura, its a great product. There is a feature that I would be very happy to have, wanted to know what are your thoughts on it. Currently there Is a nested insert feature. However having only an insert without update is not very useful. Do you have plans to implement update for nested objects? IMO, the logic would have to be: I. for lists (1:N) - for every relation record: 1. If it is present in input, not present in the db, then insert the record and link it to owning record 2. If it is present in db, not present in input, the delete it 3. If it is present in db and is present in input, then update its columns II. For objects (belongsTo) - if relation record has an ID, link it to master and update its values - if relation record has no ID, then create it - if relation record is not present in input, but is present in db, then unlink it (an option to delete it would be nice) Thank you

Posted by venelin-mihaylov on Feb 7, 2019, 1:18 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.4,000 issues0 comments

github (Other)

update nested object

venelin-mihaylovFeb 7, 2019, 1:18 PM

First, thank you very much for your work on Hasura, its a great product. There is a feature that I would be very happy to have, wanted to know what are your thoughts on it. Currently there Is a nested insert feature. However having only an insert without update is not very useful. Do you have plans to implement update for nested objects? IMO, the logic would have to be: I. for lists (1:N) - for every relation record: 1. If it is present in input, not present in the db, then insert the record and link it to owning record 2. If it is present in db, not present in input, the delete it 3. If it is present in db and is present in input, then update its columns II. For objects (belongsTo) - if relation record has an ID, link it to master and update its values - if relation record has no ID, then create it - if relation record is not present in input, but is present in db, then unlink it (an option to delete it would be nice) Thank you

Comments (0)

No comments yet. Start the discussion.

Comment on this issue