1
我想写一个突变updater
,从另一条记录中取消关联链接的记录。使用Relay Modern命令性变异API可以取消链接的记录链接吗?
例如,假设我有我的存储以下内容:
client:root {
user: {__ref: "someid"}
}
我正在寻找一种方式来取消链接user
和client:root
。 user
是一个空字段。我希望对user
字段感兴趣的订阅者看到它已经走了null
。
现在我看到取消链接此字段的唯一方法是从商店中删除节点。我尝试使用setLinkedRecord
将链接设置为null,但是会引发错误。
你尝试过'setValue'吗? https://facebook.github.io/relay/docs/mutations.html#setvalue-value-mixed-name-string-args-variables-recordproxy – whitep4nther
是的设置'null'会导致错误。 –
你有什么错误? – whitep4nther