这是indexloc提供的服务,不要输入任何密码
Skip to content

[RFC] Single row mutation #3731

@rakeshkky

Description

@rakeshkky

Currently, all mutations we have are bulk. We need to have single mutations for inserting one object for insert and update/delete by primary key column. This solves the simpler use cases for mutating a single row in a table. I'm proposing the following GraphQL schema for the same.

1.Insert

insert_author_one(object: author_insert_input!, on_conflict: author_on_conflict): author

2.Delete

delete_author_by_pk(col1: col-ty1!, col2: col-ty2!): author

3.Update

update_author_by_pk(pk_columns: table_pk_columns_input!, _set: author_set_input, _inc: author_inc_input): author
input table_pk_columns_input {
  col1: col-ty1!
  col2: col-ty2!
}

The output of all the above mutations is null-able <table-name> type. If the mutation modifies the database, then it returns the after mutation table data object for insert/update else it is a null value. For delete, it returns data if row exists (and deleted), else null if row does not exist for given primary key column value.

Metadata

Metadata

Assignees

Labels

c/serverRelated to serverk/rfcRFC for a new feature / process

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions