我在使用带有 Relay 的 File Mutation 时遇到问题。我正在尝试使用 getFiles() 创建突变
Relay.Store.commitUpdate(
new AddOrderMutation({userId: userId, medications: OrderInputTypeMedication,
userAddressId:userAddressId,files:files}),
{
onSuccess: (response) => OnResponseSuccess(response),
onFailure: (transaction,e) => console.log('transaction',transaction.getError(),'e',e),
},
);
}
transaction TypeError: Network request failed
at XMLHttpRequest.xhr.onerror (D:\ReactNative\MedexApp\node_modules\react-native\node_modules\whatwg-fetch\fetch.js:436)
尽管所有其他请求都运行良好,但我总是收到一个错误
消息。同样的突变也可以正确发送而无需附加任何文件。这是文件数组,["1489322712989.jpg":{filename:"1489322712989.jpg"
uri:"file:///storage/emulated/0/Pictures/1489322712989.jpg"}]
它从不通过提琴手发送请求或在网络服务中捕获