`fetch` and `watch` for the same query at the same time produce unexpected results
Describe the bug
If a watch subscription for a query is active, a fetch on the same query cannot complete until the watch completes. This is, because ApolloClient will use the same underlying "Concast" (their multicasting observable implementation) for both queries. fetch will then wait for this Concast's promise, which will not complete until the whole Concast is complete, which cannot happen until the watch is complete.
I am not sure if it is worth working around this or if this should just be documented. But one of the two should be done. I just spent the past two hours digging through the source and the debugger trying to figure out why my Observable did not trigger.
To Reproduce Steps to reproduce the behavior:
- Subscribe to
watch().valueChangeson aApollo.Query. - At the same time, subscribe to
fetch()on the sameApollo.Query - Observe the 2nd subscription never triggering.
Expected behavior
A fetch should trigger, even if a watch is active for the same query at the same time.
Environment:
├── @angular/[email protected]
├── @angular/[email protected]
├── @apollo/[email protected]
├── [email protected]
├── [email protected]
└── [email protected]