我已经使用 postgresql 作为数据源创建了 appsync api。现在使用 graphql 创建、更新和删除任何记录都非常简单。但我想要这样的东西,每当发生任何更新时,我只能更新该特定列的值。例如,让我们拥有包含 3 个字段的用户表:
user_id
name
city
现在,当我们为用户更新城市时,应该只更新城市:
mutation update{
updateUser(input:{user_id:"xxxxx",city:"xyz"}){
user_id
name
city
}}
用户更新输入:
input updateUserInput{
user_id!
name
city
}
有没有办法在 vtx 模板中执行此操作,或者我们必须使用 lambda 作为数据源然后执行此操作。