@apollo/client v3.0.0-beta.1 `partialRefetch: true` not working
See original GitHub issueIntended outcome:
I’m attempting to use partialRefetch
to refetch a partial array item that was add as a result of an “add” mutation.
Actual outcome:
Instead of an empty data object, the returned array is simply missing the partial objects.
How to reproduce the issue:
Client: https://codesandbox.io/s/apollo-empty-data-bug-client-ycntj Server: https://codesandbox.io/s/apollo-empty-data-bug-server-8ncuk
Line 43 can be uncommented to see the behavior when there is no partial data (i.e., the title is returned by the mutation). When that line is commented, the missing title causes the workspaces’ todos to come back as partial data and even though partialRefetch
is specified, there is no refetch.
Versions
@apollo/client: 3.0.0-beta.1
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
apollo/client v3.0.0 partialRefetch: true unexpected network ...
That issue was closed stating the problem had been fixed, but that is not the case. The network status now goes from 1...
Read more >Queries - Apollo GraphQL Docs
When your component renders, useQuery returns an object from Apollo Client that contains loading , error , and data properties you can use...
Read more >'loading' remains true when loading data with 'useQuery' using ...
I don't know what the problem is. Any help would be appreciated. react-native · apollo-client · Share.
Read more >vue/apollo-composable - Awesome JS
Fixed subscription error handling to work around some Apollo Client ... fix(smart query): initial data not retrieved from cache if query was fetched...
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
@benjamn and @hwillson, it seems to be working now!
I do have a question, though. When refetching,
data
is set toundefined
whileloading
istrue
. Would it make sense to keepdata
as the last fetched value while the refetch is happening?More specifically, I expected the behavior to be that of
refetch
whereloading
doesn’t change andnetworkStatus
goes to4
for “refetching”. While the data is being fetched, the old data is untouched.Ahh, I misinterpreted your explanation @migueloller, sorry about that! Re-opening.