diff --git a/apps/console/src/pages/FrameworkListPage.tsx b/apps/console/src/pages/FrameworkListPage.tsx index be696eea8..e381ebb29 100644 --- a/apps/console/src/pages/FrameworkListPage.tsx +++ b/apps/console/src/pages/FrameworkListPage.tsx @@ -5,6 +5,7 @@ import { usePreloadedQuery, useQueryLoader, useMutation, + ConnectionHandler, } from "react-relay"; import { Card, CardContent } from "@/components/ui/card"; import { Link, useParams } from "react-router"; @@ -57,9 +58,10 @@ const FrameworkListPageQuery = graphql` const FrameworkListPageImportFrameworkMutation = graphql` mutation FrameworkListPageImportFrameworkMutation( $input: ImportFrameworkInput! + $connections: [ID!]! ) { importFramework(input: $input) { - frameworkEdge { + frameworkEdge @prependEdge(connections: $connections) { node { id name @@ -151,6 +153,12 @@ function FrameworkListPageContent({ importFramework({ variables: { + connections: [ + ConnectionHandler.getConnectionID( + organizationId!, + "FrameworkListPage_frameworks" + ), + ], input: { organizationId: organizationId!, file: null, diff --git a/apps/console/src/pages/__generated__/FrameworkListPageImportFrameworkMutation.graphql.ts b/apps/console/src/pages/__generated__/FrameworkListPageImportFrameworkMutation.graphql.ts index 35ebe8405..ada78c60d 100644 --- a/apps/console/src/pages/__generated__/FrameworkListPageImportFrameworkMutation.graphql.ts +++ b/apps/console/src/pages/__generated__/FrameworkListPageImportFrameworkMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<92f143ac22d00fc2373928c607a105fa>> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -15,6 +15,7 @@ export type ImportFrameworkInput = { organizationId: string; }; export type FrameworkListPageImportFrameworkMutation$variables = { + connections: ReadonlyArray; input: ImportFrameworkInput; }; export type FrameworkListPageImportFrameworkMutation$data = { @@ -44,153 +45,192 @@ export type FrameworkListPageImportFrameworkMutation = { }; const node: ConcreteRequest = (function(){ -var v0 = [ +var v0 = { + "defaultValue": null, + "kind": "LocalArgument", + "name": "connections" +}, +v1 = { + "defaultValue": null, + "kind": "LocalArgument", + "name": "input" +}, +v2 = [ { - "defaultValue": null, - "kind": "LocalArgument", - "name": "input" + "kind": "Variable", + "name": "input", + "variableName": "input" } ], -v1 = { +v3 = { "alias": null, "args": null, "kind": "ScalarField", "name": "id", "storageKey": null }, -v2 = [ - { - "alias": null, - "args": [ - { - "kind": "Variable", - "name": "input", - "variableName": "input" - } +v4 = { + "alias": null, + "args": null, + "concreteType": "FrameworkEdge", + "kind": "LinkedField", + "name": "frameworkEdge", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "Framework", + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v3/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "name", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "description", + "storageKey": null + }, + { + "alias": null, + "args": [ + { + "kind": "Literal", + "name": "first", + "value": 100 + } + ], + "concreteType": "ControlConnection", + "kind": "LinkedField", + "name": "controls", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "ControlEdge", + "kind": "LinkedField", + "name": "edges", + "plural": true, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "Control", + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v3/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "state", + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": "controls(first:100)" + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "createdAt", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "updatedAt", + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": null +}; +return { + "fragment": { + "argumentDefinitions": [ + (v0/*: any*/), + (v1/*: any*/) ], - "concreteType": "ImportFrameworkPayload", - "kind": "LinkedField", - "name": "importFramework", - "plural": false, + "kind": "Fragment", + "metadata": null, + "name": "FrameworkListPageImportFrameworkMutation", "selections": [ { "alias": null, - "args": null, - "concreteType": "FrameworkEdge", + "args": (v2/*: any*/), + "concreteType": "ImportFrameworkPayload", "kind": "LinkedField", - "name": "frameworkEdge", + "name": "importFramework", "plural": false, "selections": [ - { - "alias": null, - "args": null, - "concreteType": "Framework", - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - (v1/*: any*/), - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "name", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "description", - "storageKey": null - }, - { - "alias": null, - "args": [ - { - "kind": "Literal", - "name": "first", - "value": 100 - } - ], - "concreteType": "ControlConnection", - "kind": "LinkedField", - "name": "controls", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "ControlEdge", - "kind": "LinkedField", - "name": "edges", - "plural": true, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "Control", - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - (v1/*: any*/), - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "state", - "storageKey": null - } - ], - "storageKey": null - } - ], - "storageKey": null - } - ], - "storageKey": "controls(first:100)" - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "createdAt", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "updatedAt", - "storageKey": null - } - ], - "storageKey": null - } + (v4/*: any*/) ], "storageKey": null } ], - "storageKey": null - } -]; -return { - "fragment": { - "argumentDefinitions": (v0/*: any*/), - "kind": "Fragment", - "metadata": null, - "name": "FrameworkListPageImportFrameworkMutation", - "selections": (v2/*: any*/), "type": "Mutation", "abstractKey": null }, "kind": "Request", "operation": { - "argumentDefinitions": (v0/*: any*/), + "argumentDefinitions": [ + (v1/*: any*/), + (v0/*: any*/) + ], "kind": "Operation", "name": "FrameworkListPageImportFrameworkMutation", - "selections": (v2/*: any*/) + "selections": [ + { + "alias": null, + "args": (v2/*: any*/), + "concreteType": "ImportFrameworkPayload", + "kind": "LinkedField", + "name": "importFramework", + "plural": false, + "selections": [ + (v4/*: any*/), + { + "alias": null, + "args": null, + "filters": null, + "handle": "prependEdge", + "key": "", + "kind": "LinkedHandle", + "name": "frameworkEdge", + "handleArgs": [ + { + "kind": "Variable", + "name": "connections", + "variableName": "connections" + } + ] + } + ], + "storageKey": null + } + ] }, "params": { "cacheID": "946e840d5f7bb3a33e7ee1d0e2180bb5", @@ -203,6 +243,6 @@ return { }; })(); -(node as any).hash = "715a97d6fde9a26f202e8281b9211b1f"; +(node as any).hash = "76c55c89cce3718241b2ee63f026197b"; export default node;