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.

fetchMore doesn't update the component

See original GitHub issue

Hello! I’m currently facing a strange issue with apollo fetchMore; basically, if i trigger the fetchMore function together with the notifyOnNetworkStatusChange: true, after i get the new data, and i merge in the updateQuery function, the Apollo cache is being updated, but not the component (still seeing the old items; plus, inspecting the data prop that i receive from the useQuery, i still see the old data).

On the other hand, if i set notifyOnNetworkStatusChange: false i correctly get the new data, but without the loading state.

This are all my apollo dependencies.

  "@apollo/react-hooks": "^3.1.3",
  "@apollo/react-ssr": "^3.1.3",
  "@apollo/react-testing": "^3.1.3",
  "apollo": "^2.24.0",
  "apollo-cache-inmemory": "^1.6.5",
  "apollo-client": "^2.6.8",
  "apollo-link-http": "^1.5.16",

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Emiliano-Buccicommented, Feb 27, 2020

@dylanwulf It turns out that the issue was a config i had enable (i’m using Next.js); for some reason, having reactStrictMode: true was causing this issue

1reaction
dylanwulfcommented, Feb 26, 2020

@Emiliano-Bucci Sorry, I can’t really tell what’s going on just by looking at your updateQuery function. The only way to get to the bottom of this is for someone to provide a runnable reproduction of the issue.

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 the...
Read more >
Apollo Graphql fetchMore, updateQuery does not update state
I'm not sure why, but setting a fetchPolicy for Apollo will do the job const client = new ApolloClient({ link: authLink.concat(httpLink), ...
Read more >
FetchMore not updating data with queryroot : r/graphql - Reddit
It sends network requests and load the data but doesn't render the page to include the results in the UI as well. import...
Read more >
Updating the Store – Angular - GraphQL Code Generator
With this update, our UI component should re-render and show us all of the available repositories. Let's see how to do that with...
Read more >
Apollo fetchMore's updateQuery doesn't do anything
I'm defining an observableQuery and subscribe to it in my component upon initialization. Then later on I do fetchMore but the updateQuery ...
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