From b7e9f4aab392768923fd7673578fd604a36bc6c0 Mon Sep 17 00:00:00 2001 From: gearnode Date: Wed, 19 Feb 2025 14:06:07 +0100 Subject: [PATCH] Use __id to retrive the connection id instead of explicit helper Signed-off-by: gearnode --- apps/console/src/pages/VendorListPage.tsx | 12 +++--------- .../VendorListPagePaginationQuery.graphql.ts | 16 ++++++++++++++-- .../VendorListPageQuery.graphql.ts | 14 +++++++++++++- .../VendorListPage_vendors.graphql.ts | 17 +++++++++++++++-- 4 files changed, 45 insertions(+), 14 deletions(-) diff --git a/apps/console/src/pages/VendorListPage.tsx b/apps/console/src/pages/VendorListPage.tsx index 04901a8c7..be736ec70 100644 --- a/apps/console/src/pages/VendorListPage.tsx +++ b/apps/console/src/pages/VendorListPage.tsx @@ -5,7 +5,6 @@ import { usePreloadedQuery, useQueryLoader, useMutation, - ConnectionHandler, usePaginationFragment, } from "react-relay"; import { useSearchParams } from "react-router"; @@ -48,6 +47,7 @@ const vendorListFragment = graphql` id vendors(first: $first, after: $after, last: $last, before: $before) @connection(key: "VendorListPage_vendors") { + __id edges { node { id @@ -258,10 +258,7 @@ function VendorListContent({ createVendor({ variables: { connections: [ - ConnectionHandler.getConnectionID( - data.currentOrganization.id, - "VendorListPageQuery_vendors", - ), + vendorsConnection.vendors.__id, ], input: { organizationId: data.currentOrganization.id, @@ -368,10 +365,7 @@ function VendorListContent({ deleteVendor({ variables: { connections: [ - ConnectionHandler.getConnectionID( - data.currentOrganization.id, - "VendorListPage_vendors", - ), + vendorsConnection.vendors.__id ], input: { vendorId: vendor.id, diff --git a/apps/console/src/pages/__generated__/VendorListPagePaginationQuery.graphql.ts b/apps/console/src/pages/__generated__/VendorListPagePaginationQuery.graphql.ts index 8c9b9151b..e3c638e66 100644 --- a/apps/console/src/pages/__generated__/VendorListPagePaginationQuery.graphql.ts +++ b/apps/console/src/pages/__generated__/VendorListPagePaginationQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<86f3151a87bc97ed9d37df57377f1cce>> * @lightSyntaxTransform * @nogrep */ @@ -252,6 +252,18 @@ return { } ], "storageKey": null + }, + { + "kind": "ClientExtension", + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__id", + "storageKey": null + } + ] } ], "storageKey": null @@ -285,6 +297,6 @@ return { }; })(); -(node as any).hash = "7f084d24023bc4dd68d22cdd6e75f174"; +(node as any).hash = "e8f708324eb6ffe29b4f80d62179d324"; export default node; diff --git a/apps/console/src/pages/__generated__/VendorListPageQuery.graphql.ts b/apps/console/src/pages/__generated__/VendorListPageQuery.graphql.ts index e9c078388..89abed7a7 100644 --- a/apps/console/src/pages/__generated__/VendorListPageQuery.graphql.ts +++ b/apps/console/src/pages/__generated__/VendorListPageQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<23fdb7f13c0e5f5c25485a6c4800dcb5>> + * @generated SignedSource<<229adb1cb5f4f80a57bb742ddae67448>> * @lightSyntaxTransform * @nogrep */ @@ -253,6 +253,18 @@ return { } ], "storageKey": null + }, + { + "kind": "ClientExtension", + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__id", + "storageKey": null + } + ] } ], "storageKey": null diff --git a/apps/console/src/pages/__generated__/VendorListPage_vendors.graphql.ts b/apps/console/src/pages/__generated__/VendorListPage_vendors.graphql.ts index 7ddcdac5b..c10648760 100644 --- a/apps/console/src/pages/__generated__/VendorListPage_vendors.graphql.ts +++ b/apps/console/src/pages/__generated__/VendorListPage_vendors.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<36562961e8a3be3e68279a6d56f3ef1a>> + * @generated SignedSource<<9f827470f46558fd3946d0c714a4a713>> * @lightSyntaxTransform * @nogrep */ @@ -13,6 +13,7 @@ import { FragmentRefs } from "relay-runtime"; export type VendorListPage_vendors$data = { readonly id: string; readonly vendors: { + readonly __id: string; readonly edges: ReadonlyArray<{ readonly node: { readonly createdAt: any; @@ -204,6 +205,18 @@ return { } ], "storageKey": null + }, + { + "kind": "ClientExtension", + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__id", + "storageKey": null + } + ] } ], "storageKey": null @@ -214,6 +227,6 @@ return { }; })(); -(node as any).hash = "7f084d24023bc4dd68d22cdd6e75f174"; +(node as any).hash = "e8f708324eb6ffe29b4f80d62179d324"; export default node;