Use __id to retrive the connection id instead of explicit helper

Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
gearnode
2025-02-19 14:06:07 +01:00
parent 50cc8e6b3b
commit b7e9f4aab3
4 changed files with 45 additions and 14 deletions

View File

@@ -5,7 +5,6 @@ import {
usePreloadedQuery, usePreloadedQuery,
useQueryLoader, useQueryLoader,
useMutation, useMutation,
ConnectionHandler,
usePaginationFragment, usePaginationFragment,
} from "react-relay"; } from "react-relay";
import { useSearchParams } from "react-router"; import { useSearchParams } from "react-router";
@@ -48,6 +47,7 @@ const vendorListFragment = graphql`
id id
vendors(first: $first, after: $after, last: $last, before: $before) vendors(first: $first, after: $after, last: $last, before: $before)
@connection(key: "VendorListPage_vendors") { @connection(key: "VendorListPage_vendors") {
__id
edges { edges {
node { node {
id id
@@ -258,10 +258,7 @@ function VendorListContent({
createVendor({ createVendor({
variables: { variables: {
connections: [ connections: [
ConnectionHandler.getConnectionID( vendorsConnection.vendors.__id,
data.currentOrganization.id,
"VendorListPageQuery_vendors",
),
], ],
input: { input: {
organizationId: data.currentOrganization.id, organizationId: data.currentOrganization.id,
@@ -368,10 +365,7 @@ function VendorListContent({
deleteVendor({ deleteVendor({
variables: { variables: {
connections: [ connections: [
ConnectionHandler.getConnectionID( vendorsConnection.vendors.__id
data.currentOrganization.id,
"VendorListPage_vendors",
),
], ],
input: { input: {
vendorId: vendor.id, vendorId: vendor.id,

View File

@@ -1,5 +1,5 @@
/** /**
* @generated SignedSource<<ded948fa3baf7aa7846b5db641d8c49a>> * @generated SignedSource<<86f3151a87bc97ed9d37df57377f1cce>>
* @lightSyntaxTransform * @lightSyntaxTransform
* @nogrep * @nogrep
*/ */
@@ -252,6 +252,18 @@ return {
} }
], ],
"storageKey": null "storageKey": null
},
{
"kind": "ClientExtension",
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__id",
"storageKey": null
}
]
} }
], ],
"storageKey": null "storageKey": null
@@ -285,6 +297,6 @@ return {
}; };
})(); })();
(node as any).hash = "7f084d24023bc4dd68d22cdd6e75f174"; (node as any).hash = "e8f708324eb6ffe29b4f80d62179d324";
export default node; export default node;

View File

@@ -1,5 +1,5 @@
/** /**
* @generated SignedSource<<23fdb7f13c0e5f5c25485a6c4800dcb5>> * @generated SignedSource<<229adb1cb5f4f80a57bb742ddae67448>>
* @lightSyntaxTransform * @lightSyntaxTransform
* @nogrep * @nogrep
*/ */
@@ -253,6 +253,18 @@ return {
} }
], ],
"storageKey": null "storageKey": null
},
{
"kind": "ClientExtension",
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__id",
"storageKey": null
}
]
} }
], ],
"storageKey": null "storageKey": null

View File

@@ -1,5 +1,5 @@
/** /**
* @generated SignedSource<<36562961e8a3be3e68279a6d56f3ef1a>> * @generated SignedSource<<9f827470f46558fd3946d0c714a4a713>>
* @lightSyntaxTransform * @lightSyntaxTransform
* @nogrep * @nogrep
*/ */
@@ -13,6 +13,7 @@ import { FragmentRefs } from "relay-runtime";
export type VendorListPage_vendors$data = { export type VendorListPage_vendors$data = {
readonly id: string; readonly id: string;
readonly vendors: { readonly vendors: {
readonly __id: string;
readonly edges: ReadonlyArray<{ readonly edges: ReadonlyArray<{
readonly node: { readonly node: {
readonly createdAt: any; readonly createdAt: any;
@@ -204,6 +205,18 @@ return {
} }
], ],
"storageKey": null "storageKey": null
},
{
"kind": "ClientExtension",
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__id",
"storageKey": null
}
]
} }
], ],
"storageKey": null "storageKey": null
@@ -214,6 +227,6 @@ return {
}; };
})(); })();
(node as any).hash = "7f084d24023bc4dd68d22cdd6e75f174"; (node as any).hash = "e8f708324eb6ffe29b4f80d62179d324";
export default node; export default node;