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,
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,

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<ded948fa3baf7aa7846b5db641d8c49a>>
* @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;

View File

@@ -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

View File

@@ -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;