0
我試圖使CREATE調用後,通過來自falcor路由器的響應,我的jsonGraph對象的一部分無效。我可以成功地做到這一點返回的pathValues列表,類似this earlier SE question時:無效使用jsonGraphEnvelope Falcor jsonGraph片段
{
route: 'foldersById[{keys:ids}].folders.createSubFolder',
call(callPath, args, refPaths, thisPaths) {
return createNewFolderSomehow(...)
.subscribe(folder => {
const folderPathValue = {
path: ['foldersById', folder.parentId, 'folders', folder.parentSubFolderCount -1],
value: $ref(['foldersById', folder.id])
};
const folderCollectionLengthPathValue = {
path: ['folderList', 'length'],
invalidated: true
};
return [folderPathValue, folderCollectionLengthPathValue];
});
})
}
然而,返回當量(據我所知)jsonGraphEnvelope時,失效的路徑是從響應下降:
{
route: 'foldersById[{keys:ids}].folders.createSubFolder',
call(callPath, args, refPaths, thisPaths) {
return createNewFolderSomehow(...)
.subscribe(folder => {
const newFolderPath = ['foldersById', folder.parentId, 'folders', folder.parentSubFolderCount -1];
return {
jsonGraph: R.assocPath(folderPath, $ref(['foldersById', folder.id]), {})
paths: [newFolderPath],
invalidated: [['folderList', 'length']]
};
});
})
}
我誤解了一個jsonGraphEnvelope是如何工作的(假設它是一個相當於一個PathValues數組的longhand格式)?或者這可能是一個錯誤?
將[issue](https://github.com/Netflix/falcor-router/issues/192)發佈到github。感謝您鏈接到相關代碼 - 可能會分叉並嘗試在本地進行修補。 –