Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 graphql 类型,我想根据一列的值对其进行更新。例如,该类型具有以下列:id、col1、col2、col3,所以我想更新 col3,前提是 col1 有一个值。我使用 react 作为前端,HASURA 作为后端
您可以使用该_is_null语句来检查列是否有值:
_is_null
mutation updateMutation { update_myTable(where: {id: {_eq: "id"}, _and: {col_1: {_is_null: false}}}, _set: {col_3: "new value"}) { affected_rows } }