2017-10-21 37 views
1

我想寫一個突變updater,從另一條記錄中取消關聯鏈接的記錄。使用Relay Modern命令性變異API可以取消鏈接的記錄鏈接嗎?

例如,假設我有我的存儲以下內容:

client:root { 
    user: {__ref: "someid"} 
} 

我正在尋找一種方式來取消鏈接userclient:rootuser是一個空字段。我希望對user字段感興趣的訂閱者看到它已經走了null

現在我看到取消鏈接此字段的唯一方法是從商店中刪除節點。我嘗試使用setLinkedRecord將鏈接設置爲null,但是會引發錯誤。

+0

你嘗試過'setValue'嗎? https://facebook.github.io/relay/docs/mutations.html#setvalue-value-mixed-name-string-args-variables-recordproxy – whitep4nther

+0

是的設置'null'會導致錯誤。 –

+0

你有什麼錯誤? – whitep4nther

回答

0

我只是在爲此而戰,並且在深入瞭解繼電器代碼庫之後,我決定現在還沒有一個合適的方法來解決這個問題。我有opened an issue here