question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ApolloQueryObservable not working with rxjs forkJoin #bug

See original GitHub issue

I have the problem that I need to resolve two data sources for a screen and can start rendering screen as soon as both are available. However Observable.forkJoin seem not to be working with Apollo. Is this a bug or am I doing anything wrong?

import {Observable, Subject} from "rxjs/Rx";

let fork = Observable.forkJoin(
  this.apollo.watchQuery({query:query})
);
fork.subscribe({
  (data) => console.log(data);
})

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
kamilkisielacommented, Jan 2, 2017

It’s because an Observable from the watchQuery method never completes. The forkJoin operator will work with query method (angular2-apollo since v0.8.0 returns an Observable instead of a Promise).

0reactions
kamilkisielacommented, Jan 3, 2017

@manuelfink You define what the switchMap operator returns so how it can return watchQuery instead of query?

Read more comments on GitHub >

github_iconTop Results From Across the Web

ApolloQueryObservable not working with rxjs forkJoin #bug
I have the problem that I need to resolve two data sources for a screen and can start rendering screen as soon as...
Read more >
Observable.forkJoin() doesn't execute - Stack Overflow
error (err) ); I am trying to subscribe to a result of 2 observables using forkJoin . For some reasons, the "Data received"...
Read more >
RxJS: Error Handling With forkJoin - Agira Technologies
When you are working in RxJS, one of the most difficult tasks in asynchronous programming is dealing with error handling.
Read more >
Combining Observables with forkJoin in RxJS
In this post you'll learn how to use the forkJoin operator in RxJS. ... Notice how 'Hey!' does not get emitted due to...
Read more >
The RxJs forkJoin Operator - In Depth Explanation and ...
I think one simple way of achieving it would be to just use the catchError operator and suppress any error that can happen...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found