Fix hierarchy widget pagination by prevent apollo cache mismatch
What does this MR do and why?
Fixes a bug where missing hasParent on Hierarchy widget fragment caused Apollo cache shape mismatch, leading to pagination not working on the widget.
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
The hasParent field present in work_items/graphql/work_item_widgets.fragment.graphql#L52 but not being present in work_items/graphql/work_item_hierarchy.fragment.graphql#L24 was found when a diff was ran between contents of existingWidget & incomingWidget within graphql_shared/issuable_client.js#L465.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
| Before | After |
|---|---|
| Screen_Recording_2025-01-23_at_6.51.39_PM | Screen_Recording_2025-01-23_at_6.50.21_PM |
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Visit an epic on your GDK with more than 5 child issues or epics present.
- Go to
work_items/constants.js#L253, and change value ofDEFAULT_PAGE_SIZE_CHILD_ITEMSfrom50to3. This will cause only 3 children to show on page load, and will showLoad morebutton at the bottom of the hierarchy. - Click on
Load more, it should load next batch of 3 children.- With the bug present, it loads children but hides it immediately and shows
Load moreagain, and when you click on it once more, it'll show duplicates in the tree with console errors.
- With the bug present, it loads children but hides it immediately and shows
Related to #495532 (closed), #514562 (closed)