fetchMore doesn't update the component
See original GitHub issueHello! 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:
- Created 4 years ago
- Reactions:1
- Comments:5 (3 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 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 >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
@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@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.