Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent UPDATE_COMMENT from invalidating the cache of child comments (Fix #1509 ) #1527

Merged
merged 2 commits into from
Nov 2, 2024

Conversation

riccardobl
Copy link
Member

@riccardobl riccardobl commented Oct 30, 2024

Description

The upsertComment mutation currently returns the list of child comments whenever a comment is edited. This behavior causes the Apollo cache to update, resulting in any new comments appearing upon the re-render triggered by the edit form. This PR modifies the UPDATE_COMMENT fragment to exclude the list of child comments, preventing unintended cache updates. #1509

Checklist

Are your changes backwards compatible? Please answer below:
yes

On a scale of 1-10 how well and how have you QA'd this change and any features it might affect? Please answer below:

  1. Comments are updated as expected at different levels of depth, as expected editing doesn't cause the child comments to refresh anymore.

For frontend changes: Tested on mobile? Please answer below:

Did you introduce any new environment variables? If so, call them out explicitly here:

@ekzyis ekzyis added the bug label Oct 31, 2024
@huumn huumn merged commit 193ceef into stackernews:master Nov 2, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants