-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot call map on the observable returned by watchQuery #3721
Comments
Same issue when I tried to call My workaround for now is to wrap it with rx and use map/scan operators from rxjs instead
|
That's a good idea. Though it'd be better to not have two observable dependencies in the mix. I'll have to look into this more and Ill report back. |
Agreed. Rxjs and zen observable are currently both in package.json and I wasn't sure why. Zen is objectively more lightweight than rxjs. But rxjs is objectively more robust. No matter what observable implementation we use, a user may want a different implementation and in that case would need to convert the observable by wrapping it with their library of choice Other libraries like redux observable and cycle js also introduced the concept of adapters to switch between observable implementations I think. If Apollo is going to only suppprort zen observable, that is fine, but it is worth acknowledging that users of the library may need to wrap the zen observable in an rxjs observable in order to gain access to additional operators I also think Evan Houser has a PR open to convert Apollo link to rxjs, FYI. I agree having to convert observables is not ideal. Ideally it should "just work" without having to resort to such a workaround. I suppose how we achieve that maybe up for discussion but I would vote for just switching the library to rxjs, with rxjs 6 it is actually very lightweight if you don't import all the operators. Reviewing the git log I see a lot of code churn related to zen observable. I'm not sure what the right answer is myself either but I would lean towards switching to rxjs since libraries like angular have adopted it and it is backed by Netflix. |
I would love rxjs personally. I'm just going to avoid mapping for now. I am running into more pressing bugs with cache redirects. |
I have realized my aforementioned snippet can be replaced with "from"
operator, reducing it to 4 characters.
Please write up a new issue about the cached redirects. I would be happy to
take a look.
On Tue, Jul 24, 2018 at 9:29 PM Jack Langston ***@***.***> wrote:
I would love rxjs personally. I'm just going to avoid mapping for now. I
am running into more pressing bugs with cache redirects.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3721 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AD1cOml4p2HG5YG5WbQnREUKtgGX_m_Kks5uJ_RCgaJpZM4VaAqf>
.
--
Sent from Gmail Mobile
|
This should no longer be an issue in |
@hwillson the latest version is 2.6.4 😄where I can find 2.6.8? |
Oops - good catch @testarossaaaaa! When I typed that comment I meant 2.6.3, but this should still be fixed (🤞) in 2.6.4. Thanks! |
Still an issue here for me with 3.2.4 when subscribing to |
See old issue #2788
Same exact issue reappears in Apollo 2.3.5. Possible regression?
Example code:
Throws
Cannot read property 'variables' of undefined
The text was updated successfully, but these errors were encountered: