We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
When I try to subscribe on updates like this:
this.data = this.apollo .watchQuery({ query: controllersListQuery, variables: { accountId: this.accountId, status: this.status, oemId: this.oemId, search: this.search, }, }); this.data.subscribeToMore({ document: gql` subscription OnCreateController($accountId: ID!) { controllerCreated(accountId: $accountId) { id } } `, variables: { accountId: '896ae9dd-7aed-4e5f-88d7-e93acd331f0c', }, updateQuery: (previousResult, { subscriptionData, variables }) => { console.log(previousResult, subscriptionData, variables); return previousResult; }, onError: (err) => console.error(err), });
I get an error: Cannot read property 'subscribeToMore' of undefined. As I see at some point in this place getRef() returns object without ref:
Cannot read property 'subscribeToMore' of undefined
getRef()
ref
private getObservableQuery(): ObservableQuery<T> { if (this.apollo instanceof ObservableQueryRef) { const ref = this.apollo as ObservableQueryRef; return ref.getRef(); } return this.apollo as ObservableQuery<T>; }
and when it tries to subscribeToMore() here:
subscribeToMore()
public subscribeToMore(options: any): () => void { return this.getObservableQuery().subscribeToMore(options); }
ref is undefined.
undefined
Thanks in advance for any help and big thanks for your work on this package!
The text was updated successfully, but these errors were encountered:
So from feb there is no one from the developers which can say how to use SubscribeToMore correct ?
Sorry, something went wrong.
PR #51 merged
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 branches or pull requests
Hi,
When I try to subscribe on updates like this:
I get an error:
Cannot read property 'subscribeToMore' of undefined
. As I see at some point in this placegetRef()
returns object withoutref
:and when it tries to
subscribeToMore()
here:ref
isundefined
.Thanks in advance for any help and big thanks for your work on this package!
The text was updated successfully, but these errors were encountered: