Skip to content

Add partialRefetch as an option#159

Closed
estrada9166 wants to merge 4 commits intotrojanowski:masterfrom
estrada9166:add-partialRefetch-as-option
Closed

Add partialRefetch as an option#159
estrada9166 wants to merge 4 commits intotrojanowski:masterfrom
estrada9166:add-partialRefetch-as-option

Conversation

@estrada9166
Copy link
Copy Markdown

fix #128

Taken from here

@trojanowski
Copy link
Copy Markdown
Owner

Thanks @estrada9166. Could you add a unit test for it?

Comment thread src/useQuery.ts
fetchPolicy !== 'cache-only'
) {
const partialRefetchResult = {
...result.data,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are empty so maybe it would be better, to keep stale data from previous result using useRef.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, sorry to invade this PR without introduction. I didn't catch it in time and coded basically the same thing yesterday evening. So now I'm just sharing my experience. Thanks for the PR!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comments! I'll update the PR with this! is much better.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW Also this one is related to the need of showing stale data:
#134

@trufa
Copy link
Copy Markdown

trufa commented Jul 2, 2019

@brabeji Any new for this? :) Thanks!

@brabeji
Copy link
Copy Markdown

brabeji commented Jul 2, 2019

@trufa I'm using a locally patched version of react-apollo-hooks (via patch-package) and waiting for official support from react-apollo: apollographql/react-apollo#2892 (comment)

@estrada9166 estrada9166 closed this Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

partialRefetch as an option

4 participants