no-cache smart queries are throwing exceptions in optimistic UI updates (#280)

This short circuits unproductive cache work for no-cache queries that will not exist
This commit is contained in:
gaberudy
2018-05-21 10:37:57 -07:00
committed by Guillaume Chau
parent ba5a840e62
commit 82d6c02f7b
+5 -3
View File
@@ -87,10 +87,12 @@ export default class SmartQuery extends SmartApollo {
})
}
const currentResult = this.maySetLoading()
if (this.options.fetchPolicy !== "no-cache") {
const currentResult = this.maySetLoading()
if (!currentResult.loading) {
this.nextResult(currentResult)
if (!currentResult.loading) {
this.nextResult(currentResult)
}
}
super.executeApollo(variables)