File tree Expand file tree Collapse file tree
Tests/ApolloCacheDependentTests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -604,7 +604,6 @@ class WatchQueryTests: XCTestCase, CacheTesting {
604604 let hasPicardFriendExpecation = self . expectation ( description: " Has friend named Jean-Luc Picard " )
605605 let hasHanSoloFriendExpecation = self . expectation ( description: " Has friend named Han Solo " )
606606 let initialFetchExpectation = self . expectation ( description: " Initial fetch " )
607- var isInitialFetch = true
608607 var expectedDependentKeys = [
609608 " 0.__typename " ,
610609 " 0.friends " ,
@@ -616,12 +615,14 @@ class WatchQueryTests: XCTestCase, CacheTesting {
616615 " QUERY_ROOT.hero " ,
617616 ]
618617
618+ #warning("Figure out if there's a way not have the fetch also cause a cache update to fire without putting the context back in everywhere")
619+ var fetchCount = 0
619620 _ = client. watch ( query: query) { result in
620621 defer {
621- if isInitialFetch {
622- isInitialFetch = false
622+ if fetchCount == 1 {
623623 initialFetchExpectation. fulfill ( )
624624 }
625+ fetchCount += 1
625626 }
626627 switch result {
627628 case . success( let graphQLResult) :
You can’t perform that action at this time.
0 commit comments