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