Skip to content

update nested object #1573

@venelin-mihaylov

Description

@venelin-mihaylov

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

Metadata

Metadata

Assignees

Labels

a/api/graphqlc/serverRelated to serverk/enhancementNew feature or improve an existing featurep/highcandidate for being included in the upcoming sprints/triagedThis has been reviewed by Hasurat/native-dbstriage/4-rfc-publishedThe RFC is published and comments are requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions