From 493d29cfd5989142e254fa42c9e366c165ab0c4a Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 17 Jun 2025 17:33:38 +0200 Subject: [PATCH] Add pagination on data Signed-off-by: Bryan Frimin --- apps/console/src/hooks/graph/DatumGraph.ts | 43 +- .../DatumGraphListQuery.graphql.ts | 392 +++++++----------- .../src/pages/organizations/data/DataPage.tsx | 90 +++- .../__generated__/DataListQuery.graphql.ts | 391 +++++++++++++++++ .../__generated__/DataPageFragment.graphql.ts | 323 +++++++++++++++ 5 files changed, 950 insertions(+), 289 deletions(-) create mode 100644 apps/console/src/pages/organizations/data/__generated__/DataListQuery.graphql.ts create mode 100644 apps/console/src/pages/organizations/data/__generated__/DataPageFragment.graphql.ts diff --git a/apps/console/src/hooks/graph/DatumGraph.ts b/apps/console/src/hooks/graph/DatumGraph.ts index 2cf8d10b6..160ec8d78 100644 --- a/apps/console/src/hooks/graph/DatumGraph.ts +++ b/apps/console/src/hooks/graph/DatumGraph.ts @@ -1,38 +1,14 @@ import { graphql } from "relay-runtime"; -import { useMutation, usePreloadedQuery, type PreloadedQuery } from "react-relay"; +import { useMutation } from "react-relay"; import { useConfirm } from "@probo/ui"; import { useTranslate } from "@probo/i18n"; import { promisifyMutation, sprintf } from "@probo/helpers"; -import { useMemo } from "react"; -import type { DatumGraphListQuery } from "./__generated__/DatumGraphListQuery.graphql"; export const dataQuery = graphql` query DatumGraphListQuery($organizationId: ID!) { node(id: $organizationId) { ... on Organization { - data(first: 100) @connection(key: "DataPage_data") { - __id - edges { - node { - id - name - dataClassification - owner { - fullName - } - vendors(first: 50) { - edges { - node { - id - name - websiteUrl - } - } - } - createdAt - } - } - } + ...DataPageFragment } } } @@ -223,18 +199,3 @@ export const useUpdateDatum = () => { }); }; }; - -export const useData = (queryRef: PreloadedQuery) => { - const data = usePreloadedQuery(dataQuery, queryRef); - - return useMemo(() => { - const dataEntries = data.node?.data?.edges.map((edge) => edge.node) ?? []; - const connectionId = data.node?.data?.__id ?? ""; - - return { - dataEntries, - connectionId, - rawData: data, - }; - }, [data]); -}; diff --git a/apps/console/src/hooks/graph/__generated__/DatumGraphListQuery.graphql.ts b/apps/console/src/hooks/graph/__generated__/DatumGraphListQuery.graphql.ts index 461fd4269..fbeb79d2d 100644 --- a/apps/console/src/hooks/graph/__generated__/DatumGraphListQuery.graphql.ts +++ b/apps/console/src/hooks/graph/__generated__/DatumGraphListQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<157213d294566208969ddbfd7e79fd91>> * @lightSyntaxTransform * @nogrep */ @@ -9,35 +9,13 @@ // @ts-nocheck import { ConcreteRequest } from 'relay-runtime'; -export type DataClassification = "CONFIDENTIAL" | "INTERNAL" | "PUBLIC" | "SECRET"; +import { FragmentRefs } from "relay-runtime"; export type DatumGraphListQuery$variables = { organizationId: string; }; export type DatumGraphListQuery$data = { readonly node: { - readonly data?: { - readonly __id: string; - readonly edges: ReadonlyArray<{ - readonly node: { - readonly createdAt: any; - readonly dataClassification: DataClassification; - readonly id: string; - readonly name: string; - readonly owner: { - readonly fullName: string; - }; - readonly vendors: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly id: string; - readonly name: string; - readonly websiteUrl: string | null | undefined; - }; - }>; - }; - }; - }>; - }; + readonly " $fragmentSpreads": FragmentRefs<"DataPageFragment">; }; }; export type DatumGraphListQuery = { @@ -64,143 +42,30 @@ v2 = { "alias": null, "args": null, "kind": "ScalarField", - "name": "id", + "name": "__typename", "storageKey": null }, v3 = { "alias": null, "args": null, "kind": "ScalarField", - "name": "name", - "storageKey": null -}, -v4 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "dataClassification", + "name": "id", "storageKey": null }, +v4 = [ + { + "kind": "Literal", + "name": "first", + "value": 10 + } +], v5 = { "alias": null, "args": null, "kind": "ScalarField", - "name": "fullName", + "name": "name", "storageKey": null -}, -v6 = { - "alias": null, - "args": [ - { - "kind": "Literal", - "name": "first", - "value": 50 - } - ], - "concreteType": "VendorConnection", - "kind": "LinkedField", - "name": "vendors", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "VendorEdge", - "kind": "LinkedField", - "name": "edges", - "plural": true, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "Vendor", - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - (v2/*: any*/), - (v3/*: any*/), - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "websiteUrl", - "storageKey": null - } - ], - "storageKey": null - } - ], - "storageKey": null - } - ], - "storageKey": "vendors(first:50)" -}, -v7 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "createdAt", - "storageKey": null -}, -v8 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "__typename", - "storageKey": null -}, -v9 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "cursor", - "storageKey": null -}, -v10 = { - "alias": null, - "args": null, - "concreteType": "PageInfo", - "kind": "LinkedField", - "name": "pageInfo", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "endCursor", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "hasNextPage", - "storageKey": null - } - ], - "storageKey": null -}, -v11 = { - "kind": "ClientExtension", - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "__id", - "storageKey": null - } - ] -}, -v12 = [ - { - "kind": "Literal", - "name": "first", - "value": 100 - } -]; +}; return { "fragment": { "argumentDefinitions": (v0/*: any*/), @@ -220,58 +85,9 @@ return { "kind": "InlineFragment", "selections": [ { - "alias": "data", "args": null, - "concreteType": "DatumConnection", - "kind": "LinkedField", - "name": "__DataPage_data_connection", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "DatumEdge", - "kind": "LinkedField", - "name": "edges", - "plural": true, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "Datum", - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - (v2/*: any*/), - (v3/*: any*/), - (v4/*: any*/), - { - "alias": null, - "args": null, - "concreteType": "People", - "kind": "LinkedField", - "name": "owner", - "plural": false, - "selections": [ - (v5/*: any*/) - ], - "storageKey": null - }, - (v6/*: any*/), - (v7/*: any*/), - (v8/*: any*/) - ], - "storageKey": null - }, - (v9/*: any*/) - ], - "storageKey": null - }, - (v10/*: any*/), - (v11/*: any*/) - ], - "storageKey": null + "kind": "FragmentSpread", + "name": "DataPageFragment" } ], "type": "Organization", @@ -298,13 +114,14 @@ return { "name": "node", "plural": false, "selections": [ - (v8/*: any*/), + (v2/*: any*/), + (v3/*: any*/), { "kind": "InlineFragment", "selections": [ { "alias": null, - "args": (v12/*: any*/), + "args": (v4/*: any*/), "concreteType": "DatumConnection", "kind": "LinkedField", "name": "data", @@ -326,9 +143,15 @@ return { "name": "node", "plural": false, "selections": [ - (v2/*: any*/), (v3/*: any*/), - (v4/*: any*/), + (v5/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "dataClassification", + "storageKey": null + }, { "alias": null, "args": null, @@ -337,30 +160,146 @@ return { "name": "owner", "plural": false, "selections": [ - (v5/*: any*/), - (v2/*: any*/) + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "fullName", + "storageKey": null + }, + (v3/*: any*/) ], "storageKey": null }, - (v6/*: any*/), - (v7/*: any*/), - (v8/*: any*/) + { + "alias": null, + "args": [ + { + "kind": "Literal", + "name": "first", + "value": 50 + } + ], + "concreteType": "VendorConnection", + "kind": "LinkedField", + "name": "vendors", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "VendorEdge", + "kind": "LinkedField", + "name": "edges", + "plural": true, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "Vendor", + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v3/*: any*/), + (v5/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "websiteUrl", + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": "vendors(first:50)" + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "createdAt", + "storageKey": null + }, + (v2/*: any*/) ], "storageKey": null }, - (v9/*: any*/) + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "cursor", + "storageKey": null + } ], "storageKey": null }, - (v10/*: any*/), - (v11/*: any*/) + { + "alias": null, + "args": null, + "concreteType": "PageInfo", + "kind": "LinkedField", + "name": "pageInfo", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "endCursor", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "hasNextPage", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "hasPreviousPage", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "startCursor", + "storageKey": null + } + ], + "storageKey": null + }, + { + "kind": "ClientExtension", + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__id", + "storageKey": null + } + ] + } ], - "storageKey": "data(first:100)" + "storageKey": "data(first:10)" }, { "alias": null, - "args": (v12/*: any*/), - "filters": null, + "args": (v4/*: any*/), + "filters": [ + "orderBy" + ], "handle": "connection", "key": "DataPage_data", "kind": "LinkedHandle", @@ -369,36 +308,23 @@ return { ], "type": "Organization", "abstractKey": null - }, - (v2/*: any*/) + } ], "storageKey": null } ] }, "params": { - "cacheID": "a9d2d911138e13ea75c85f64f310c41d", + "cacheID": "93f16f8bcd6ae56a947a18b90146fac4", "id": null, - "metadata": { - "connection": [ - { - "count": null, - "cursor": null, - "direction": "forward", - "path": [ - "node", - "data" - ] - } - ] - }, + "metadata": {}, "name": "DatumGraphListQuery", "operationKind": "query", - "text": "query DatumGraphListQuery(\n $organizationId: ID!\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n data(first: 100) {\n edges {\n node {\n id\n name\n dataClassification\n owner {\n fullName\n id\n }\n vendors(first: 50) {\n edges {\n node {\n id\n name\n websiteUrl\n }\n }\n }\n createdAt\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n id\n }\n}\n" + "text": "query DatumGraphListQuery(\n $organizationId: ID!\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...DataPageFragment\n }\n id\n }\n}\n\nfragment DataPageFragment on Organization {\n data(first: 10) {\n edges {\n node {\n id\n name\n dataClassification\n owner {\n fullName\n id\n }\n vendors(first: 50) {\n edges {\n node {\n id\n name\n websiteUrl\n }\n }\n }\n createdAt\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n" } }; })(); -(node as any).hash = "525bc7b05c73f821c23f8694d1ba2981"; +(node as any).hash = "ebacc146f9ff0dc7fac8dcfcb8e6f74a"; export default node; diff --git a/apps/console/src/pages/organizations/data/DataPage.tsx b/apps/console/src/pages/organizations/data/DataPage.tsx index 152fb0735..7e21c5ffb 100644 --- a/apps/console/src/pages/organizations/data/DataPage.tsx +++ b/apps/console/src/pages/organizations/data/DataPage.tsx @@ -2,7 +2,6 @@ import { Button, IconPlusLarge, PageHeader, - Table, Thead, Tbody, Tr, @@ -16,15 +15,66 @@ import { } from "@probo/ui"; import { useTranslate } from "@probo/i18n"; import { usePageTitle } from "@probo/hooks"; -import { type PreloadedQuery } from "react-relay"; +import { + usePaginationFragment, + usePreloadedQuery, + type PreloadedQuery, +} from "react-relay"; import { useOrganizationId } from "/hooks/useOrganizationId"; import { CreateDatumDialog } from "./dialogs/CreateDatumDialog"; -import { useDeleteDatum, useData } from "../../../hooks/graph/DatumGraph"; +import { useDeleteDatum, dataQuery } from "../../../hooks/graph/DatumGraph"; import type { DatumGraphListQuery } from "/hooks/graph/__generated__/DatumGraphListQuery.graphql"; import { faviconUrl } from "@probo/helpers"; import type { NodeOf } from "/types"; +import type { + DataPageFragment$data, + DataPageFragment$key, +} from "./__generated__/DataPageFragment.graphql"; +import { SortableTable } from "/components/SortableTable"; -type DataEntry = NodeOf["data"]>>; +const paginatedDataFragment = graphql` + fragment DataPageFragment on Organization + @refetchable(queryName: "DataListQuery") + @argumentDefinitions( + first: { type: "Int", defaultValue: 10 } + orderBy: { type: "DatumOrder", defaultValue: null } + after: { type: "CursorKey", defaultValue: null } + before: { type: "CursorKey", defaultValue: null } + last: { type: "Int", defaultValue: null } + ) { + data( + first: $first + after: $after + last: $last + before: $before + orderBy: $orderBy + ) @connection(key: "DataPage_data") { + __id + edges { + node { + id + name + dataClassification + owner { + fullName + } + vendors(first: 50) { + edges { + node { + id + name + websiteUrl + } + } + } + createdAt + } + } + } + } +`; + +type DataEntry = NodeOf; type Props = { queryRef: PreloadedQuery; @@ -34,7 +84,14 @@ export default function DataPage(props: Props) { const { __ } = useTranslate(); const organizationId = useOrganizationId(); - const { dataEntries, connectionId } = useData(props.queryRef); + const data = usePreloadedQuery(dataQuery, props.queryRef); + const pagination = usePaginationFragment( + paginatedDataFragment, + data.node as DataPageFragment$key + ); + + const dataEntries = pagination.data.data.edges.map((edge) => edge.node); + const connectionId = pagination.data.data.__id; usePageTitle(__("Data")); @@ -46,11 +103,14 @@ export default function DataPage(props: Props) { "Manage your organization's data assets and their classifications." )} > - + - + @@ -62,14 +122,10 @@ export default function DataPage(props: Props) { {dataEntries.map((entry) => ( - + ))} -
{__("Name")}
+ ); } @@ -84,7 +140,7 @@ function DataRow({ const organizationId = useOrganizationId(); const { __ } = useTranslate(); const deleteDatum = useDeleteDatum(entry, connectionId); - const vendors = entry.vendors?.edges.map(edge => edge.node) ?? []; + const vendors = entry.vendors?.edges.map((edge) => edge.node) ?? []; return ( @@ -97,7 +153,11 @@ function DataRow({ {vendors.length > 0 ? (
{vendors.slice(0, 3).map((vendor) => ( - + > + * @lightSyntaxTransform + * @nogrep + */ + +/* tslint:disable */ +/* eslint-disable */ +// @ts-nocheck + +import { ConcreteRequest } from 'relay-runtime'; +import { FragmentRefs } from "relay-runtime"; +export type DatumOrderField = "CREATED_AT" | "DATA_CLASSIFICATION" | "NAME"; +export type OrderDirection = "ASC" | "DESC"; +export type DatumOrder = { + direction: OrderDirection; + field: DatumOrderField; +}; +export type DataListQuery$variables = { + after?: any | null | undefined; + before?: any | null | undefined; + first?: number | null | undefined; + id: string; + last?: number | null | undefined; + orderBy?: DatumOrder | null | undefined; +}; +export type DataListQuery$data = { + readonly node: { + readonly " $fragmentSpreads": FragmentRefs<"DataPageFragment">; + }; +}; +export type DataListQuery = { + response: DataListQuery$data; + variables: DataListQuery$variables; +}; + +const node: ConcreteRequest = (function(){ +var v0 = { + "defaultValue": null, + "kind": "LocalArgument", + "name": "after" +}, +v1 = { + "defaultValue": null, + "kind": "LocalArgument", + "name": "before" +}, +v2 = { + "defaultValue": 10, + "kind": "LocalArgument", + "name": "first" +}, +v3 = { + "defaultValue": null, + "kind": "LocalArgument", + "name": "id" +}, +v4 = { + "defaultValue": null, + "kind": "LocalArgument", + "name": "last" +}, +v5 = { + "defaultValue": null, + "kind": "LocalArgument", + "name": "orderBy" +}, +v6 = [ + { + "kind": "Variable", + "name": "id", + "variableName": "id" + } +], +v7 = [ + { + "kind": "Variable", + "name": "after", + "variableName": "after" + }, + { + "kind": "Variable", + "name": "before", + "variableName": "before" + }, + { + "kind": "Variable", + "name": "first", + "variableName": "first" + }, + { + "kind": "Variable", + "name": "last", + "variableName": "last" + }, + { + "kind": "Variable", + "name": "orderBy", + "variableName": "orderBy" + } +], +v8 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__typename", + "storageKey": null +}, +v9 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "id", + "storageKey": null +}, +v10 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "name", + "storageKey": null +}; +return { + "fragment": { + "argumentDefinitions": [ + (v0/*: any*/), + (v1/*: any*/), + (v2/*: any*/), + (v3/*: any*/), + (v4/*: any*/), + (v5/*: any*/) + ], + "kind": "Fragment", + "metadata": null, + "name": "DataListQuery", + "selections": [ + { + "alias": null, + "args": (v6/*: any*/), + "concreteType": null, + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + { + "args": (v7/*: any*/), + "kind": "FragmentSpread", + "name": "DataPageFragment" + } + ], + "storageKey": null + } + ], + "type": "Query", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": [ + (v0/*: any*/), + (v1/*: any*/), + (v2/*: any*/), + (v4/*: any*/), + (v5/*: any*/), + (v3/*: any*/) + ], + "kind": "Operation", + "name": "DataListQuery", + "selections": [ + { + "alias": null, + "args": (v6/*: any*/), + "concreteType": null, + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v8/*: any*/), + (v9/*: any*/), + { + "kind": "InlineFragment", + "selections": [ + { + "alias": null, + "args": (v7/*: any*/), + "concreteType": "DatumConnection", + "kind": "LinkedField", + "name": "data", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "DatumEdge", + "kind": "LinkedField", + "name": "edges", + "plural": true, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "Datum", + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v9/*: any*/), + (v10/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "dataClassification", + "storageKey": null + }, + { + "alias": null, + "args": null, + "concreteType": "People", + "kind": "LinkedField", + "name": "owner", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "fullName", + "storageKey": null + }, + (v9/*: any*/) + ], + "storageKey": null + }, + { + "alias": null, + "args": [ + { + "kind": "Literal", + "name": "first", + "value": 50 + } + ], + "concreteType": "VendorConnection", + "kind": "LinkedField", + "name": "vendors", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "VendorEdge", + "kind": "LinkedField", + "name": "edges", + "plural": true, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "Vendor", + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v9/*: any*/), + (v10/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "websiteUrl", + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": "vendors(first:50)" + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "createdAt", + "storageKey": null + }, + (v8/*: any*/) + ], + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "cursor", + "storageKey": null + } + ], + "storageKey": null + }, + { + "alias": null, + "args": null, + "concreteType": "PageInfo", + "kind": "LinkedField", + "name": "pageInfo", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "endCursor", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "hasNextPage", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "hasPreviousPage", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "startCursor", + "storageKey": null + } + ], + "storageKey": null + }, + { + "kind": "ClientExtension", + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__id", + "storageKey": null + } + ] + } + ], + "storageKey": null + }, + { + "alias": null, + "args": (v7/*: any*/), + "filters": [ + "orderBy" + ], + "handle": "connection", + "key": "DataPage_data", + "kind": "LinkedHandle", + "name": "data" + } + ], + "type": "Organization", + "abstractKey": null + } + ], + "storageKey": null + } + ] + }, + "params": { + "cacheID": "d6742fb1de534407018aeb39ca1438d5", + "id": null, + "metadata": {}, + "name": "DataListQuery", + "operationKind": "query", + "text": "query DataListQuery(\n $after: CursorKey = null\n $before: CursorKey = null\n $first: Int = 10\n $last: Int = null\n $orderBy: DatumOrder = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...DataPageFragment_sdb03\n id\n }\n}\n\nfragment DataPageFragment_sdb03 on Organization {\n data(first: $first, after: $after, last: $last, before: $before, orderBy: $orderBy) {\n edges {\n node {\n id\n name\n dataClassification\n owner {\n fullName\n id\n }\n vendors(first: 50) {\n edges {\n node {\n id\n name\n websiteUrl\n }\n }\n }\n createdAt\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n" + } +}; +})(); + +(node as any).hash = "a797d00b7f2cac2876322b23aa781efa"; + +export default node; diff --git a/apps/console/src/pages/organizations/data/__generated__/DataPageFragment.graphql.ts b/apps/console/src/pages/organizations/data/__generated__/DataPageFragment.graphql.ts new file mode 100644 index 000000000..832634874 --- /dev/null +++ b/apps/console/src/pages/organizations/data/__generated__/DataPageFragment.graphql.ts @@ -0,0 +1,323 @@ +/** + * @generated SignedSource<<0eb94f0da29f50445248a3d133714be2>> + * @lightSyntaxTransform + * @nogrep + */ + +/* tslint:disable */ +/* eslint-disable */ +// @ts-nocheck + +import { ReaderFragment } from 'relay-runtime'; +export type DataClassification = "CONFIDENTIAL" | "INTERNAL" | "PUBLIC" | "SECRET"; +import { FragmentRefs } from "relay-runtime"; +export type DataPageFragment$data = { + readonly data: { + readonly __id: string; + readonly edges: ReadonlyArray<{ + readonly node: { + readonly createdAt: any; + readonly dataClassification: DataClassification; + readonly id: string; + readonly name: string; + readonly owner: { + readonly fullName: string; + }; + readonly vendors: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly id: string; + readonly name: string; + readonly websiteUrl: string | null | undefined; + }; + }>; + }; + }; + }>; + }; + readonly id: string; + readonly " $fragmentType": "DataPageFragment"; +}; +export type DataPageFragment$key = { + readonly " $data"?: DataPageFragment$data; + readonly " $fragmentSpreads": FragmentRefs<"DataPageFragment">; +}; + +import DataListQuery_graphql from './DataListQuery.graphql'; + +const node: ReaderFragment = (function(){ +var v0 = [ + "data" +], +v1 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "id", + "storageKey": null +}, +v2 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "name", + "storageKey": null +}; +return { + "argumentDefinitions": [ + { + "defaultValue": null, + "kind": "LocalArgument", + "name": "after" + }, + { + "defaultValue": null, + "kind": "LocalArgument", + "name": "before" + }, + { + "defaultValue": 10, + "kind": "LocalArgument", + "name": "first" + }, + { + "defaultValue": null, + "kind": "LocalArgument", + "name": "last" + }, + { + "defaultValue": null, + "kind": "LocalArgument", + "name": "orderBy" + } + ], + "kind": "Fragment", + "metadata": { + "connection": [ + { + "count": null, + "cursor": null, + "direction": "bidirectional", + "path": (v0/*: any*/) + } + ], + "refetch": { + "connection": { + "forward": { + "count": "first", + "cursor": "after" + }, + "backward": { + "count": "last", + "cursor": "before" + }, + "path": (v0/*: any*/) + }, + "fragmentPathInResult": [ + "node" + ], + "operation": DataListQuery_graphql, + "identifierInfo": { + "identifierField": "id", + "identifierQueryVariableName": "id" + } + } + }, + "name": "DataPageFragment", + "selections": [ + { + "alias": "data", + "args": [ + { + "kind": "Variable", + "name": "orderBy", + "variableName": "orderBy" + } + ], + "concreteType": "DatumConnection", + "kind": "LinkedField", + "name": "__DataPage_data_connection", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "DatumEdge", + "kind": "LinkedField", + "name": "edges", + "plural": true, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "Datum", + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v1/*: any*/), + (v2/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "dataClassification", + "storageKey": null + }, + { + "alias": null, + "args": null, + "concreteType": "People", + "kind": "LinkedField", + "name": "owner", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "fullName", + "storageKey": null + } + ], + "storageKey": null + }, + { + "alias": null, + "args": [ + { + "kind": "Literal", + "name": "first", + "value": 50 + } + ], + "concreteType": "VendorConnection", + "kind": "LinkedField", + "name": "vendors", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "VendorEdge", + "kind": "LinkedField", + "name": "edges", + "plural": true, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "Vendor", + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v1/*: any*/), + (v2/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "websiteUrl", + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": "vendors(first:50)" + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "createdAt", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__typename", + "storageKey": null + } + ], + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "cursor", + "storageKey": null + } + ], + "storageKey": null + }, + { + "alias": null, + "args": null, + "concreteType": "PageInfo", + "kind": "LinkedField", + "name": "pageInfo", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "endCursor", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "hasNextPage", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "hasPreviousPage", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "startCursor", + "storageKey": null + } + ], + "storageKey": null + }, + { + "kind": "ClientExtension", + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__id", + "storageKey": null + } + ] + } + ], + "storageKey": null + }, + (v1/*: any*/) + ], + "type": "Organization", + "abstractKey": null +}; +})(); + +(node as any).hash = "a797d00b7f2cac2876322b23aa781efa"; + +export default node;