Skip to content
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

Typings are wrong for Observable.lift #36

Open
armstrjare opened this issue Feb 7, 2017 · 3 comments
Open

Typings are wrong for Observable.lift #36

armstrjare opened this issue Feb 7, 2017 · 3 comments

Comments

@armstrjare
Copy link

I think this is wrong - has broken stuff for me.

Should be something like...

public lift<R>(operator: Operator<ApolloQueryResult<T>, R>): Observable<R> {

Otherwise map etc doesn't work.

I'm currently getting typescript compile errors because of the type mismatch when i use .map

rxObs.map(result => result.data)  // invalid type, as T is not compatible with ApolloQueryResult<T>

See also:

@armstrjare
Copy link
Author

armstrjare commented Feb 7, 2017

Actually, turns out this line wasn't actually the reason the compile errors were coming through (I hadn't updated other types to remove my ApolloQueryResult wrapping).

But - I think the typings for lift are still wrong, even if it doesn't result in type errors (because the types are not checked since rxjs is compiled to es5?)

@armstrjare armstrjare changed the title Typings are wrong for Observable.lift (breaks map, etc.) Typings are wrong for Observable.lift Feb 7, 2017
@kamilkisiela
Copy link
Owner

@armstrjare Could you create a reproduction? It could be even in /tests/RxObservableQuery.ts.

@kamilkisiela
Copy link
Owner

If you use apollo-angular then we changed the way ApolloClient works with RxJS. You can check it here: kamilkisiela/apollo-angular#377

No more this kind of issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants