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

Add generic types to RxObservableQuery #30

Merged
merged 3 commits into from Feb 4, 2017
Merged

Add generic types to RxObservableQuery #30

merged 3 commits into from Feb 4, 2017

Conversation

kamilkisiela
Copy link
Owner

No description provided.

@@ -19,7 +19,7 @@ export class RxObservableQuery<T> extends Observable<T> {
}
}

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@armstrjare Could you post a PR?

@armstrjare
Copy link

armstrjare commented Feb 7, 2017 via email

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

Successfully merging this pull request may close these issues.

None yet

2 participants