Closed fischerman closed 7 years ago
The solution @calebmer suggested (wrapping the watchQuery in an Observable.from) does not work. Same behavior.
@fischerman I will take a look on that. Observable.from
is good but you loose all the methods of ApolloObservableQuery
, so you cannot use watchQuery
etc.
Thanks @kamilkisiela
Just to clarify:
Observable.from(this.apollo.watchQuery({...}))
.do(() => {
console.log(1)
})
.do(() => {
console.log(2);
})
.do(() => {
console.log(3);
})
.subscribe()
does NOT fix the issue. Same result: 3
Can you think of a workaround?
Try not to use the Angular2Apollo
service, instead of that, use a clear instance of ApolloClient
. this.apollo.watchQuery
means that you're using ApolloClient that has been wrapped with RxJS (a part of apollo-client-rxjs
).
an example:
const client: ApolloClient = ...;
Observable.from(client.watchQuery({...}))
.do.do.do;
@fischerman seems like it's working... hmmm
Take a look at #28
When I find the time I will try to reproduce my behavior in a Plunker. The workaround you suggested works for now.
@kamilkisiela can't reproduce
it works with the latest angular-cli and apollo-angular
From https://github.com/apollostack/apollo-client/issues/1207
Whenever I chain the result of watchQuery only the last observable in the chain get's invoked. The following returns only 3, but 1 and 2 are missing.
To compare the following returns the expected 1,2,3
Am I missing something or is this a bug?
rxjs@5.0.0-rc.4 angular2-apollo@0.9.0-rc.5 apollo-client-rxjs@0.4.0