Skip to content

Commit 82d6c02

Browse files
gaberudyAkryum
authored andcommitted
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
1 parent ba5a840 commit 82d6c02

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/smart-query.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,12 @@ export default class SmartQuery extends SmartApollo {
8787
})
8888
}
8989

90-
const currentResult = this.maySetLoading()
90+
if (this.options.fetchPolicy !== "no-cache") {
91+
const currentResult = this.maySetLoading()
9192

92-
if (!currentResult.loading) {
93-
this.nextResult(currentResult)
93+
if (!currentResult.loading) {
94+
this.nextResult(currentResult)
95+
}
9496
}
9597

9698
super.executeApollo(variables)

0 commit comments

Comments
 (0)