apollo-client icon indicating copy to clipboard operation
apollo-client copied to clipboard

Deprecate partialRefetch

Open brainkim opened this issue 4 years ago • 2 comments

While investigating #7861, and after a conversation with @benjamn, I’ve learned that the partialRefetch option for useQuery might be a candidate for deprecation. The reasoning is that fetch policies are more consistently applied in Apollo 3, and for instance, the cache-first fetch policy will actually refetch missing fields automatically.

This issue is to track adding a deprecation warning for when people set partialRefetch to true. We can add it in 3.4 or later, and remove it in 4.0.

Additionally, we can use this issue to track documentation changes (they recommend setting this option to true and that false is the legacy), which I have been told is strictly false.

We can also use this issue to field objections from the community, should they exist. If you are using partialRefetch, we’d like to hear from you.

brainkim avatar Apr 09 '21 20:04 brainkim

@brainkim @benjamn based on our 4.0 discussion today, this issue is likely going to go away (after the React layer rewrite). I'll flag this for 4.0 as a reminder.

hwillson avatar May 12 '21 00:05 hwillson

fwiw @hwillson @benjamn we're still seeing regular scenarios in the latest release where partial cache can cause data to be undefined and not be refetched, even with a cache policy of cache-first. Setting partialRefetch: true seems to resolve the issue. I'm not sure how to work around these issues if this option is deprecated.

kainosnoema avatar Aug 05 '22 22:08 kainosnoema