Help need, after update, fetchMore didnot work.
See original GitHub issueold 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:
- Created 6 years ago
- Comments:13 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@helfer I am getting similar
ObservableQuery with this id doesn't exist
error when usingfetchMore()
withoutgraphql
HOC.After calling
query.subscribe()
, thenfetchMore()
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 thegraphql
HOC, the pre-requisites to have it working properly should be documented.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?