diff --git a/web/src/components/molecules/Content/types.ts b/web/src/components/molecules/Content/types.ts index 412dc10f96..ee19cc46af 100644 --- a/web/src/components/molecules/Content/types.ts +++ b/web/src/components/molecules/Content/types.ts @@ -20,6 +20,7 @@ export type Item = { createdAt: Date; updatedAt: Date; status: ItemStatus; + referencedItems?: FormItem[]; fields: ItemField[] | undefined | null; metadata: { id?: string; diff --git a/web/src/components/organisms/Project/Content/ContentDetails/hooks.ts b/web/src/components/organisms/Project/Content/ContentDetails/hooks.ts index ad159f50a6..215891db6b 100644 --- a/web/src/components/organisms/Project/Content/ContentDetails/hooks.ts +++ b/web/src/components/organisms/Project/Content/ContentDetails/hooks.ts @@ -33,7 +33,6 @@ import { useUpdateItemMutation, useUpdateRequestMutation, useSearchItemQuery, - useGetItemsByIdsQuery, useGetGroupsQuery, FieldType as GQLFieldType, StringOperator, @@ -188,27 +187,9 @@ export default () => { [data?.node], ); - const formReferenceItemsIds = useMemo( - () => - (currentItem?.fields - ?.filter( - field => field.type === "Reference" && field.value && typeof field.value === "string", - ) - .map(field => field.value) as string[]) ?? [], - [currentItem?.fields], - ); - - const { data: gqlFormItemsData } = useGetItemsByIdsQuery({ - fetchPolicy: "no-cache", - variables: { - id: formReferenceItemsIds, - }, - skip: formReferenceItemsIds.length === 0, - }); - const formItemsData: FormItem[] | undefined = useMemo( - () => gqlFormItemsData?.nodes as FormItem[], - [gqlFormItemsData?.nodes], + () => currentItem?.referencedItems as FormItem[], + [currentItem?.referencedItems], ); const { data: groupData } = useGetGroupsQuery({ diff --git a/web/src/components/organisms/Project/Content/ContentList/hooks.ts b/web/src/components/organisms/Project/Content/ContentList/hooks.ts index 1bab3d6f21..2fb957df0e 100644 --- a/web/src/components/organisms/Project/Content/ContentList/hooks.ts +++ b/web/src/components/organisms/Project/Content/ContentList/hooks.ts @@ -23,7 +23,6 @@ import { Comment as GQLComment, useSearchItemQuery, Asset as GQLAsset, - useGetItemsByIdsQuery, useUpdateItemMutation, useCreateItemMutation, SchemaFieldType, @@ -113,34 +112,15 @@ export default () => { selectedRowKeys: [], }); - const referencedItemsIds = useMemo( - () => - data?.searchItem?.nodes - ? data.searchItem.nodes - .filter(item => item?.fields && item?.fields.length > 0) - .flatMap( - item => - item?.fields - .filter(field => field.type === "Reference" && field.value) - .map(field => field.value), - ) - : [], - [data], - ); - - const { data: referencedItems } = useGetItemsByIdsQuery({ - fetchPolicy: "no-cache", - variables: { - id: referencedItemsIds, - }, - skip: !referencedItemsIds.length, - }); - // eslint-disable-next-line react-hooks/exhaustive-deps const referencedItemsMap = new Map(); - (referencedItems?.nodes ?? []).forEach(item => { - if (item && item.__typename === "Item") { - referencedItemsMap.set(item.id, item); + data?.searchItem.nodes?.forEach(item => { + if (item?.referencedItems && item.referencedItems.length > 0) { + item.referencedItems.forEach(reference => { + if (!referencedItemsMap.has(reference.id)) { + referencedItemsMap.set(reference.id, reference); + } + }); } }); diff --git a/web/src/components/organisms/Project/Content/utils.ts b/web/src/components/organisms/Project/Content/utils.ts index 62ceadf023..647eee0835 100644 --- a/web/src/components/organisms/Project/Content/utils.ts +++ b/web/src/components/organisms/Project/Content/utils.ts @@ -16,6 +16,16 @@ export const convertItem = (GQLItem: GQLItem | undefined): Item | undefined => { }) as ItemField, ), status: GQLItem.status, + referencedItems: + GQLItem.referencedItems?.map(item => ({ + id: item.id, + title: item.title ?? "", + schemaId: item.schemaId, + createdBy: item.createdBy?.name ?? "", + status: item.status, + createdAt: item.createdAt, + updatedAt: item.updatedAt, + })) ?? [], createdBy: GQLItem.createdBy?.name, updatedBy: GQLItem.updatedBy?.name, createdAt: GQLItem.createdAt, diff --git a/web/src/gql/graphql-client-api.tsx b/web/src/gql/graphql-client-api.tsx index 4857954331..7b1ebaaec8 100644 --- a/web/src/gql/graphql-client-api.tsx +++ b/web/src/gql/graphql-client-api.tsx @@ -575,6 +575,7 @@ export type Item = Node & { originalId?: Maybe; project: Project; projectId: Scalars['ID']; + referencedItems?: Maybe>; schema: Schema; schemaId: Scalars['ID']; status: ItemStatus; @@ -2394,14 +2395,14 @@ export type GetItemsQueryVariables = Exact<{ }>; -export type GetItemsQuery = { __typename?: 'Query', searchItem: { __typename?: 'ItemConnection', totalCount: number, nodes: Array<{ __typename?: 'Item', id: string, title?: string | null, schemaId: string, createdAt: Date, updatedAt: Date, status: ItemStatus, createdBy?: { __typename?: 'Integration', name: string } | { __typename?: 'User', name: string } | null, fields: Array<{ __typename?: 'ItemField', schemaFieldId: string, itemGroupId?: string | null, type: SchemaFieldType, value?: any | null }>, thread: { __typename?: 'Thread', id: string, workspaceId: string, comments: Array<{ __typename?: 'Comment', id: string, authorId: string, content: string, createdAt: Date, author?: { __typename?: 'Integration', id: string, name: string } | { __typename?: 'User', id: string, name: string, email: string } | null }> }, metadata?: { __typename?: 'Item', id: string, version: string, fields: Array<{ __typename?: 'ItemField', schemaFieldId: string, itemGroupId?: string | null, type: SchemaFieldType, value?: any | null }> } | null } | null> } }; +export type GetItemsQuery = { __typename?: 'Query', searchItem: { __typename?: 'ItemConnection', totalCount: number, nodes: Array<{ __typename?: 'Item', id: string, title?: string | null, schemaId: string, createdAt: Date, updatedAt: Date, status: ItemStatus, referencedItems?: Array<{ __typename?: 'Item', id: string, title?: string | null, schemaId: string, status: ItemStatus, createdAt: Date, updatedAt: Date, createdBy?: { __typename?: 'Integration', name: string } | { __typename?: 'User', name: string } | null }> | null, createdBy?: { __typename?: 'Integration', name: string } | { __typename?: 'User', name: string } | null, fields: Array<{ __typename?: 'ItemField', schemaFieldId: string, itemGroupId?: string | null, type: SchemaFieldType, value?: any | null }>, thread: { __typename?: 'Thread', id: string, workspaceId: string, comments: Array<{ __typename?: 'Comment', id: string, authorId: string, content: string, createdAt: Date, author?: { __typename?: 'Integration', id: string, name: string } | { __typename?: 'User', id: string, name: string, email: string } | null }> }, metadata?: { __typename?: 'Item', id: string, version: string, fields: Array<{ __typename?: 'ItemField', schemaFieldId: string, itemGroupId?: string | null, type: SchemaFieldType, value?: any | null }> } | null } | null> } }; export type GetItemQueryVariables = Exact<{ id: Scalars['ID']; }>; -export type GetItemQuery = { __typename?: 'Query', node?: { __typename?: 'Asset' } | { __typename?: 'Group' } | { __typename?: 'Integration' } | { __typename?: 'Item', id: string, title?: string | null, schemaId: string, createdAt: Date, updatedAt: Date, status: ItemStatus, version: string, assets: Array<{ __typename?: 'Asset', id: string, url: string } | null>, createdBy?: { __typename?: 'Integration', name: string } | { __typename?: 'User', name: string } | null, updatedBy?: { __typename?: 'Integration', name: string } | { __typename?: 'User', name: string } | null, fields: Array<{ __typename?: 'ItemField', schemaFieldId: string, itemGroupId?: string | null, type: SchemaFieldType, value?: any | null }>, metadata?: { __typename?: 'Item', id: string, version: string, fields: Array<{ __typename?: 'ItemField', schemaFieldId: string, type: SchemaFieldType, value?: any | null }> } | null, thread: { __typename?: 'Thread', id: string, workspaceId: string, comments: Array<{ __typename?: 'Comment', id: string, authorId: string, content: string, createdAt: Date, author?: { __typename?: 'Integration', id: string, name: string } | { __typename?: 'User', id: string, name: string, email: string } | null }> } } | { __typename?: 'Model' } | { __typename?: 'Project' } | { __typename?: 'Request' } | { __typename?: 'Schema' } | { __typename?: 'User' } | { __typename?: 'View' } | { __typename?: 'Workspace' } | { __typename?: 'WorkspaceSettings' } | null }; +export type GetItemQuery = { __typename?: 'Query', node?: { __typename?: 'Asset' } | { __typename?: 'Group' } | { __typename?: 'Integration' } | { __typename?: 'Item', id: string, title?: string | null, schemaId: string, createdAt: Date, updatedAt: Date, status: ItemStatus, version: string, referencedItems?: Array<{ __typename?: 'Item', id: string, title?: string | null, schemaId: string, status: ItemStatus, createdAt: Date, updatedAt: Date, createdBy?: { __typename?: 'Integration', name: string } | { __typename?: 'User', name: string } | null }> | null, assets: Array<{ __typename?: 'Asset', id: string, url: string } | null>, createdBy?: { __typename?: 'Integration', name: string } | { __typename?: 'User', name: string } | null, updatedBy?: { __typename?: 'Integration', name: string } | { __typename?: 'User', name: string } | null, fields: Array<{ __typename?: 'ItemField', schemaFieldId: string, itemGroupId?: string | null, type: SchemaFieldType, value?: any | null }>, metadata?: { __typename?: 'Item', id: string, version: string, fields: Array<{ __typename?: 'ItemField', schemaFieldId: string, type: SchemaFieldType, value?: any | null }> } | null, thread: { __typename?: 'Thread', id: string, workspaceId: string, comments: Array<{ __typename?: 'Comment', id: string, authorId: string, content: string, createdAt: Date, author?: { __typename?: 'Integration', id: string, name: string } | { __typename?: 'User', id: string, name: string, email: string } | null }> } } | { __typename?: 'Model' } | { __typename?: 'Project' } | { __typename?: 'Request' } | { __typename?: 'Schema' } | { __typename?: 'User' } | { __typename?: 'View' } | { __typename?: 'Workspace' } | { __typename?: 'WorkspaceSettings' } | null }; export type IsItemReferencedQueryVariables = Exact<{ itemId: Scalars['ID']; @@ -2411,19 +2412,12 @@ export type IsItemReferencedQueryVariables = Exact<{ export type IsItemReferencedQuery = { __typename?: 'Query', isItemReferenced: boolean }; -export type GetItemsByIdsQueryVariables = Exact<{ - id: Array | Scalars['ID']; -}>; - - -export type GetItemsByIdsQuery = { __typename?: 'Query', nodes: Array<{ __typename?: 'Asset' } | { __typename?: 'Group' } | { __typename?: 'Integration' } | { __typename?: 'Item', id: string, title?: string | null, schemaId: string, createdAt: Date, updatedAt: Date, status: ItemStatus } | { __typename?: 'Model' } | { __typename?: 'Project' } | { __typename?: 'Request' } | { __typename?: 'Schema' } | { __typename?: 'User' } | { __typename?: 'View' } | { __typename?: 'Workspace' } | { __typename?: 'WorkspaceSettings' } | null> }; - export type SearchItemQueryVariables = Exact<{ searchItemInput: SearchItemInput; }>; -export type SearchItemQuery = { __typename?: 'Query', searchItem: { __typename?: 'ItemConnection', totalCount: number, nodes: Array<{ __typename?: 'Item', id: string, title?: string | null, schemaId: string, createdAt: Date, updatedAt: Date, status: ItemStatus, version: string, assets: Array<{ __typename?: 'Asset', id: string, url: string } | null>, fields: Array<{ __typename?: 'ItemField', schemaFieldId: string, itemGroupId?: string | null, type: SchemaFieldType, value?: any | null }>, createdBy?: { __typename?: 'Integration', name: string } | { __typename?: 'User', name: string } | null, updatedBy?: { __typename: 'Integration', name: string } | { __typename: 'User', name: string } | null, metadata?: { __typename?: 'Item', id: string, version: string, fields: Array<{ __typename?: 'ItemField', schemaFieldId: string, type: SchemaFieldType, value?: any | null }> } | null, thread: { __typename?: 'Thread', id: string, workspaceId: string, comments: Array<{ __typename?: 'Comment', id: string, authorId: string, content: string, createdAt: Date, author?: { __typename?: 'Integration', id: string, name: string } | { __typename?: 'User', id: string, name: string, email: string } | null }> } } | null>, pageInfo: { __typename?: 'PageInfo', hasNextPage: boolean, hasPreviousPage: boolean, startCursor?: string | null, endCursor?: string | null } } }; +export type SearchItemQuery = { __typename?: 'Query', searchItem: { __typename?: 'ItemConnection', totalCount: number, nodes: Array<{ __typename?: 'Item', id: string, title?: string | null, schemaId: string, createdAt: Date, updatedAt: Date, status: ItemStatus, version: string, referencedItems?: Array<{ __typename?: 'Item', id: string, title?: string | null, schemaId: string, status: ItemStatus, createdAt: Date, updatedAt: Date, createdBy?: { __typename?: 'Integration', name: string } | { __typename?: 'User', name: string } | null }> | null, assets: Array<{ __typename?: 'Asset', id: string, url: string } | null>, fields: Array<{ __typename?: 'ItemField', schemaFieldId: string, itemGroupId?: string | null, type: SchemaFieldType, value?: any | null }>, createdBy?: { __typename?: 'Integration', name: string } | { __typename?: 'User', name: string } | null, updatedBy?: { __typename: 'Integration', name: string } | { __typename: 'User', name: string } | null, metadata?: { __typename?: 'Item', id: string, version: string, fields: Array<{ __typename?: 'ItemField', schemaFieldId: string, type: SchemaFieldType, value?: any | null }> } | null, thread: { __typename?: 'Thread', id: string, workspaceId: string, comments: Array<{ __typename?: 'Comment', id: string, authorId: string, content: string, createdAt: Date, author?: { __typename?: 'Integration', id: string, name: string } | { __typename?: 'User', id: string, name: string, email: string } | null }> } } | null>, pageInfo: { __typename?: 'PageInfo', hasNextPage: boolean, hasPreviousPage: boolean, startCursor?: string | null, endCursor?: string | null } } }; export type CreateItemMutationVariables = Exact<{ modelId: Scalars['ID']; @@ -2433,7 +2427,7 @@ export type CreateItemMutationVariables = Exact<{ }>; -export type CreateItemMutation = { __typename?: 'Mutation', createItem?: { __typename?: 'ItemPayload', item: { __typename?: 'Item', id: string, schemaId: string, fields: Array<{ __typename?: 'ItemField', value?: any | null, type: SchemaFieldType, schemaFieldId: string, itemGroupId?: string | null }> } } | null }; +export type CreateItemMutation = { __typename?: 'Mutation', createItem?: { __typename?: 'ItemPayload', item: { __typename?: 'Item', id: string, schemaId: string, fields: Array<{ __typename?: 'ItemField', value?: any | null, type: SchemaFieldType, schemaFieldId: string, itemGroupId?: string | null }>, referencedItems?: Array<{ __typename?: 'Item', id: string, title?: string | null, schemaId: string, status: ItemStatus, createdAt: Date, updatedAt: Date, createdBy?: { __typename?: 'Integration', name: string } | { __typename?: 'User', name: string } | null }> | null } } | null }; export type DeleteItemMutationVariables = Exact<{ itemId: Scalars['ID']; @@ -2450,21 +2444,21 @@ export type UpdateItemMutationVariables = Exact<{ }>; -export type UpdateItemMutation = { __typename?: 'Mutation', updateItem?: { __typename?: 'ItemPayload', item: { __typename?: 'Item', id: string, schemaId: string, fields: Array<{ __typename?: 'ItemField', value?: any | null, type: SchemaFieldType, schemaFieldId: string, itemGroupId?: string | null }> } } | null }; +export type UpdateItemMutation = { __typename?: 'Mutation', updateItem?: { __typename?: 'ItemPayload', item: { __typename?: 'Item', id: string, schemaId: string, fields: Array<{ __typename?: 'ItemField', value?: any | null, type: SchemaFieldType, schemaFieldId: string, itemGroupId?: string | null }>, referencedItems?: Array<{ __typename?: 'Item', id: string, title?: string | null, schemaId: string, status: ItemStatus, createdAt: Date, updatedAt: Date, createdBy?: { __typename?: 'Integration', name: string } | { __typename?: 'User', name: string } | null }> | null } } | null }; export type UnpublishItemMutationVariables = Exact<{ itemIds: Array | Scalars['ID']; }>; -export type UnpublishItemMutation = { __typename?: 'Mutation', unpublishItem?: { __typename?: 'UnpublishItemPayload', items: Array<{ __typename?: 'Item', id: string }> } | null }; +export type UnpublishItemMutation = { __typename?: 'Mutation', unpublishItem?: { __typename?: 'UnpublishItemPayload', items: Array<{ __typename?: 'Item', id: string, referencedItems?: Array<{ __typename?: 'Item', id: string, title?: string | null, schemaId: string, status: ItemStatus, createdAt: Date, updatedAt: Date, createdBy?: { __typename?: 'Integration', name: string } | { __typename?: 'User', name: string } | null }> | null }> } | null }; export type PublishItemMutationVariables = Exact<{ itemIds: Array | Scalars['ID']; }>; -export type PublishItemMutation = { __typename?: 'Mutation', publishItem?: { __typename?: 'PublishItemPayload', items: Array<{ __typename?: 'Item', id: string }> } | null }; +export type PublishItemMutation = { __typename?: 'Mutation', publishItem?: { __typename?: 'PublishItemPayload', items: Array<{ __typename?: 'Item', id: string, referencedItems?: Array<{ __typename?: 'Item', id: string, title?: string | null, schemaId: string, status: ItemStatus, createdAt: Date, updatedAt: Date, createdBy?: { __typename?: 'Integration', name: string } | { __typename?: 'User', name: string } | null }> | null }> } | null }; export type GetModelsQueryVariables = Exact<{ projectId: Scalars['ID']; @@ -4323,6 +4317,22 @@ export const GetItemsDocument = gql` createdAt updatedAt status + referencedItems { + id + title + schemaId + createdBy { + ... on Integration { + name + } + ... on User { + name + } + } + status + createdAt + updatedAt + } createdBy { ... on Integration { name @@ -4394,6 +4404,22 @@ export const GetItemDocument = gql` createdAt updatedAt status + referencedItems { + id + title + schemaId + createdBy { + ... on Integration { + name + } + ... on User { + name + } + } + status + createdAt + updatedAt + } version assets { id @@ -4499,48 +4525,6 @@ export function useIsItemReferencedLazyQuery(baseOptions?: Apollo.LazyQueryHookO export type IsItemReferencedQueryHookResult = ReturnType; export type IsItemReferencedLazyQueryHookResult = ReturnType; export type IsItemReferencedQueryResult = Apollo.QueryResult; -export const GetItemsByIdsDocument = gql` - query GetItemsByIds($id: [ID!]!) { - nodes(id: $id, type: Item) { - ... on Item { - id - title - schemaId - createdAt - updatedAt - status - } - } -} - `; - -/** - * __useGetItemsByIdsQuery__ - * - * To run a query within a React component, call `useGetItemsByIdsQuery` and pass it any options that fit your needs. - * When your component renders, `useGetItemsByIdsQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetItemsByIdsQuery({ - * variables: { - * id: // value for 'id' - * }, - * }); - */ -export function useGetItemsByIdsQuery(baseOptions: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(GetItemsByIdsDocument, options); - } -export function useGetItemsByIdsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(GetItemsByIdsDocument, options); - } -export type GetItemsByIdsQueryHookResult = ReturnType; -export type GetItemsByIdsLazyQueryHookResult = ReturnType; -export type GetItemsByIdsQueryResult = Apollo.QueryResult; export const SearchItemDocument = gql` query SearchItem($searchItemInput: SearchItemInput!) { searchItem(input: $searchItemInput) { @@ -4551,6 +4535,22 @@ export const SearchItemDocument = gql` createdAt updatedAt status + referencedItems { + id + title + schemaId + createdBy { + ... on Integration { + name + } + ... on User { + name + } + } + status + createdAt + updatedAt + } version assets { id @@ -4645,6 +4645,22 @@ export const CreateItemDocument = gql` schemaFieldId itemGroupId } + referencedItems { + id + title + schemaId + createdBy { + ... on Integration { + name + } + ... on User { + name + } + } + status + createdAt + updatedAt + } } } } @@ -4725,6 +4741,22 @@ export const UpdateItemDocument = gql` schemaFieldId itemGroupId } + referencedItems { + id + title + schemaId + createdBy { + ... on Integration { + name + } + ... on User { + name + } + } + status + createdAt + updatedAt + } } } } @@ -4763,6 +4795,22 @@ export const UnpublishItemDocument = gql` unpublishItem(input: {itemIds: $itemIds}) { items { id + referencedItems { + id + title + schemaId + createdBy { + ... on Integration { + name + } + ... on User { + name + } + } + status + createdAt + updatedAt + } } } } @@ -4798,6 +4846,22 @@ export const PublishItemDocument = gql` publishItem(input: {itemIds: $itemIds}) { items { id + referencedItems { + id + title + schemaId + createdBy { + ... on Integration { + name + } + ... on User { + name + } + } + status + createdAt + updatedAt + } } } } diff --git a/web/src/gql/graphql.schema.json b/web/src/gql/graphql.schema.json index 9d7e75367c..adf5e87e84 100644 --- a/web/src/gql/graphql.schema.json +++ b/web/src/gql/graphql.schema.json @@ -4915,6 +4915,26 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "referencedItems", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Item", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "schema", "description": null, diff --git a/web/src/gql/queries/item.ts b/web/src/gql/queries/item.ts index 8c71938bdd..b4a99f47b2 100644 --- a/web/src/gql/queries/item.ts +++ b/web/src/gql/queries/item.ts @@ -12,6 +12,22 @@ export const GET_ITEMS = gql` createdAt updatedAt status + referencedItems { + id + title + schemaId + createdBy { + ... on Integration { + name + } + ... on User { + name + } + } + status + createdAt + updatedAt + } createdBy { ... on Integration { name @@ -57,6 +73,22 @@ export const GET_ITEM_NODE = gql` createdAt updatedAt status + referencedItems { + id + title + schemaId + createdBy { + ... on Integration { + name + } + ... on User { + name + } + } + status + createdAt + updatedAt + } version assets { id @@ -107,21 +139,6 @@ export const IS_ITEM_REFERENCED = gql` } `; -export const GET_ITEMS_BY_IDS = gql` - query GetItemsByIds($id: [ID!]!) { - nodes(id: $id, type: Item) { - ... on Item { - id - title - schemaId - createdAt - updatedAt - status - } - } - } -`; - export const SEARCH_ITEM = gql` query SearchItem($searchItemInput: SearchItemInput!) { searchItem(input: $searchItemInput) { @@ -132,6 +149,22 @@ export const SEARCH_ITEM = gql` createdAt updatedAt status + referencedItems { + id + title + schemaId + createdBy { + ... on Integration { + name + } + ... on User { + name + } + } + status + createdAt + updatedAt + } version assets { id @@ -201,6 +234,22 @@ export const CREATE_ITEM = gql` schemaFieldId itemGroupId } + referencedItems { + id + title + schemaId + createdBy { + ... on Integration { + name + } + ... on User { + name + } + } + status + createdAt + updatedAt + } } } } @@ -233,6 +282,22 @@ export const UPDATE_ITEM = gql` schemaFieldId itemGroupId } + referencedItems { + id + title + schemaId + createdBy { + ... on Integration { + name + } + ... on User { + name + } + } + status + createdAt + updatedAt + } } } } @@ -243,6 +308,22 @@ export const UNPUBLISH_ITEM = gql` unpublishItem(input: { itemIds: $itemIds }) { items { id + referencedItems { + id + title + schemaId + createdBy { + ... on Integration { + name + } + ... on User { + name + } + } + status + createdAt + updatedAt + } } } } @@ -253,6 +334,22 @@ export const PUBLISH_ITEM = gql` publishItem(input: { itemIds: $itemIds }) { items { id + referencedItems { + id + title + schemaId + createdBy { + ... on Integration { + name + } + ... on User { + name + } + } + status + createdAt + updatedAt + } } } }