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
Fix issues with typescript 2.4.1 & rxjs 5.4.2 and update #44
Conversation
This has also been testing with an application running typescript 2.4.1 & rxjs 5.4.2 |
Removing a logic from An example: const obs = new RxObservableQuery(apolloObs)
.map(({data}) => data.products);
// and later use
obs.refetch(); |
@kamilkisiela, it seems impossible to extend it at it currently stands for some weird reason. You can still use specific methods but you have to include the type for RxObservableQuery.. As seen in the tests from :
you will need to specify the whole type..
|
@kamilkisiela , can we discuss this please.. As I personally need this :) |
Hello, any updates on this? Thanks! |
@kamilkisiela ... Any update? |
@pfrendo I'll take a look on it tomorrow |
@kamilkisiela This should solve #36 as well, right? |
@kamilkisiela ... any update please???? |
Is it nearly fixed? :) |
Any update here? Would love to get this in so can use the latest versions again! @kamilkisiela |
@lukemadera in the meantime do you have a version number I can use that works? This is my first adventure in the Apollo world and I can't seem to get it working 😞 |
@jjenzz With typescript@2.3.4 it's working fine. |
@mwld Thank you. I switched version and my app compiled if I set the property type to
For anyone else that may have a similar issue, this fixed it for me: angular/angular#17800 (comment) |
@jjenzz what fixed it for you? Reverting typescript to 2.3.4? Or were you able to get it to work with an up to date typescript? |
Can we at least have an approx. date when the fix is going to be released? I'm stuck. apollo-client-rxjs can't use 4.1.0 and another library depends on ^4.1.0 |
quick walk around (this.apollo.watchQuery({query, variables, fetchPolicy}) as any).map(({data}) => this.handleResponseData(data) |
I've added |
Workaround suggested by @b091 actually works. |
Updating to |
I can confirm this. typescript@2.4.x + apollo-client@1.9.2 do work now. What was missing in my code was the generic type for the return value - you might want to check this. // Pseudo code
myQuery(): ApolloQueryResult<myResultType> {
// ...
return this.apollo.query<myResultType>(...)
}
myWatchQuery(): ApolloQueryObservable<myResultType> {
// ...
return this.apollo.watchQuery<myResultType>(...)
}
myMutation(): ApolloExecutionResult<myResultType> {
// ...
return this.apollo.mutate<myResultType>(...)
} |
Try this one private getCampaigns(): ApolloQueryObservable<QueryResponse> {
return this.apollo.watchQuery<QueryResponse>({
query: query
});
} as described in my examples above |
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. |
No description provided.