-
Notifications
You must be signed in to change notification settings - Fork 787
MockedProvider - Cannot read property 'registeredQueries' of undefined #2738
Comments
This seems unrelated. |
console.log(
'----------------------------hey I am in the right spot',
this.state.client.queryManager,
)
var scheduler = this.state.client.queryManager.scheduler
Object.keys(scheduler.registeredQueries).forEach(function(queryId) {
scheduler.stopPollingQuery(queryId)
})
Object.keys(scheduler.intervalQueries).forEach(function(interval) {
scheduler.fetchQueriesOnInterval(interval)
}) hmmm... |
As far as I can tell by skimming over the linked commit, it should now be in |
Discussion summary from slack: this api was not intended to be public, should probably have been marked as |
This reverts commit d4f3346. Although apollographql/react-apollo#2738 resulted immediately from the removal of the scheduler, similar problems will almost certainly arise from privatizing client.queryManager.
Inspired by apollographql/react-apollo#2738, it should be possible to shut down an ApolloClient instance without making assumptions about its implementation details. This client.stop() method should also be useful for server-side rendering, where you're supposed to create (and throw away) a new ApolloClient instance for each request. I'm not entirely sure this implementation cleans up everything that might need to be cleaned up, but I am sure it's better than nothing.
This has been fixed as of |
I'm getting this error. I am not using registeredQueries anywhere in my code.
|
@stolinski you need to update your version of react-apollo. |
@rosskevin ah, gotcha. I was thinking 2.5.1 was the latest. That seemed to have done it. Thanks! |
@rosskevin, @stolinski : just for your information: |
@rosskevin, @stolinski - I'm getting the exact same error described by @ashoksudani. Was using 2.5.8, and only rolling back to 2.3.3 or removing all instances of |
Issue occurs with apollo-client@2.63 and react-apollo@2.3.3 |
Sorry, forgot to mention the most important part - it goes away with react-apollo@2.4.0 which supports |
This issue also occurs with |
Intended outcome:
MockedProvider works in storybook(?) without error.
Actual outcome:
How to reproduce the issue:
On initial click on a story, everything is good. Switch to a different story- good. Switch back to the first story- boom.
This appears to be a race condition that is adjacent to what we saw in #2164 and @danilobuerger fixed in #2165. I have spotted a potential root cause - working on it and PR now.
Version
The text was updated successfully, but these errors were encountered: