question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Help need, after update, fetchMore didnot work.

See original GitHub issue

old version: “react-apollo”: “^0.5.13”, “apollo-client”: “^0.4.22”,

update version: “react-apollo”: “^0.7.1”, “apollo-client”: “^0.5.18”,

the code below did not work on update version:

this.query = props.client.watchQuery({
  query: gql`${query}`,
  variables: {
    offset: this.state.length
  }
});

  this.query.fetchMore({
    variables: {
      offset: this.state.length
    },
    updateQuery: (previousResult, { fetchMoreResult }) => {
      if (!fetchMoreResult) { return previousResult; }
      return Object.assign({}, previousResult, {
        // Append the new feed results to the old one
      });
    }
  }).

it printed error: Uncaught (in promise) Error: ObservableQuery with this id doesn’t exist:

Anybody can help me out? Thank you very much!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
kctangcommented, Sep 19, 2017

@helfer I am getting similar ObservableQuery with this id doesn't exist error when using fetchMore() without graphql HOC.

After calling query.subscribe(), then fetchMore() works. As I am still new to GraphQL & Apollo, I do not know why but at least it works.

Unless fetchMore() is meant to only be used within the graphql HOC, the pre-requisites to have it working properly should be documented.

4reactions
smeijercommented, Aug 3, 2018

Experiencing it too sometimes. I haven’t been investigating this yet, but I suspect it’s due to an unmounted / unmounting component. Possible that it’s a race condition?

Read more comments on GitHub >

github_iconTop Results From Across the Web

fetchMore not updating the data - Help - Apollo GraphQL
I 'm using the fetchMore() function against a button click to show the updated data but the data is not being updated nor...
Read more >
Graphql - Apollo Client/ React - Cache - fetchMore doesn't ...
I logged the existing and incoming argument in the merge function, and it seems that for each fetchMore that had filter, new data...
Read more >
Use fetchMore and merge field policies to dynamically load ...
[4:06] Here I can customize the behavior of different fields in my cache. Under the root query type from its fields, I want...
Read more >
Fetching Data with Apollo Client & GraphQL for Infinite Loader
For the purposes of this article, I'll assume we already have a GraphQL ... including data, the loading state, and the fetchMore function....
Read more >
Pitfalls I fell into during Apollo Client 3.0 migration
There are quite a few updates in Apollo 3.0 so I never underestimated the ... Basically, you need to avoid adding a new...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found