[PR #4537] [MERGED] fix: resolve GraphQL collection tree and tab dissociation issues #4849

Closed
opened 2026-03-17 02:20:51 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/4537
Author: @jamesgeorge007
Created: 11/14/2024
Status: Merged
Merged: 11/22/2024
Merged by: @jamesgeorge007

Base: nextHead: fix/gql-collection-tree-tab-sync


📝 Commits (2)

  • 14ae565 fix: resolve dissociation issues with GraphQL collection tree and tab
  • 1fa7352 chore: update GQL request tab save context schema

📊 Changes

6 files changed (+78 additions, -24 deletions)

View changed files

📝 packages/hoppscotch-common/src/components/collections/SaveRequest.vue (+42 -7)
📝 packages/hoppscotch-common/src/components/collections/graphql/AddRequest.vue (+3 -3)
📝 packages/hoppscotch-common/src/components/collections/graphql/EditRequest.vue (+19 -1)
📝 packages/hoppscotch-common/src/components/collections/graphql/index.vue (+3 -11)
📝 packages/hoppscotch-common/src/newstore/collections.ts (+10 -0)
📝 packages/hoppscotch-common/src/services/persistence/validation-schemas/index.ts (+1 -2)

📄 Description

This PR aims to resolve the issues with the GraphQL workspace, where requests from the collection tree and the ones open under tabs get dissociated following certain actions.

Dissociation due to request move and overwrite via spotlight Save as new request actions are beyond the scope.

Closes HFE-546 #4500.

What's changed

  • The saveGraphqlRequestAs function exposed from the store premises, invoking the underlying dispatcher now returns the insertion index for the request being added.
  • Updates the places of consumption of the above to leverage the insertion index and resolve issues with the pre-existing implementation where the request index came up as undefined resulting in dissociation with the tab.
  • Updates signature for the OnAddRequest method in the CollectionGraphql component removing index (resolved as undefined) from the incoming data and leveraging the request index instead.
  • Resolve type errors in the CollectionsGraphqlAddRequest component.
  • Updates the GQL tab request save context schema enabling requirement for the requestIndex field existence as a follow up of #4211.

Notes to reviewers

Please ensure to verify actions except for moves and overwrites via the Save as new request from the spotlight with requests from the collection tree and that the association is kept with the tabs in which they're open:

  • Adding request under a root/child level collection.
  • Saving the request open in the current tab under a collection. It should open the above request in a new tab.
  • Editing a request.
  • The above actions within the Save as modal.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/4537 **Author:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Created:** 11/14/2024 **Status:** ✅ Merged **Merged:** 11/22/2024 **Merged by:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Base:** `next` ← **Head:** `fix/gql-collection-tree-tab-sync` --- ### 📝 Commits (2) - [`14ae565`](https://github.com/hoppscotch/hoppscotch/commit/14ae5651ac931b364b4d8de447514978df27778b) fix: resolve dissociation issues with GraphQL collection tree and tab - [`1fa7352`](https://github.com/hoppscotch/hoppscotch/commit/1fa7352a0f8ee203cc468ca79d2578b07040dbc2) chore: update GQL request tab save context schema ### 📊 Changes **6 files changed** (+78 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/src/components/collections/SaveRequest.vue` (+42 -7) 📝 `packages/hoppscotch-common/src/components/collections/graphql/AddRequest.vue` (+3 -3) 📝 `packages/hoppscotch-common/src/components/collections/graphql/EditRequest.vue` (+19 -1) 📝 `packages/hoppscotch-common/src/components/collections/graphql/index.vue` (+3 -11) 📝 `packages/hoppscotch-common/src/newstore/collections.ts` (+10 -0) 📝 `packages/hoppscotch-common/src/services/persistence/validation-schemas/index.ts` (+1 -2) </details> ### 📄 Description This PR aims to resolve the issues with the GraphQL workspace, where requests from the collection tree and the ones open under tabs get dissociated following certain actions. > Dissociation due to request move and overwrite via spotlight `Save as new request` actions are beyond the scope. Closes HFE-546 #4500. ### What's changed - The `saveGraphqlRequestAs` function exposed from the store premises, invoking the underlying dispatcher now returns the insertion index for the request being added. - Updates the places of consumption of the above to leverage the insertion index and resolve issues with the pre-existing implementation where the request index came up as `undefined` resulting in dissociation with the tab. - Updates signature for the `OnAddRequest` method in the `CollectionGraphql` component removing `index` (resolved as `undefined`) from the incoming data and leveraging the request index instead. - Resolve type errors in the `CollectionsGraphqlAddRequest` component. - Updates the GQL tab request save context schema enabling requirement for the `requestIndex` field existence as a follow up of #4211. ### Notes to reviewers Please ensure to verify actions except for moves and overwrites via the `Save as new request` from the spotlight with requests from the collection tree and that the association is kept with the tabs in which they're open: - Adding request under a root/child level collection. - Saving the request open in the current tab under a collection. It should open the above request in a new tab. - Editing a request. - The above actions within the `Save as` modal. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:20:51 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#4849
No description provided.