Separate system operations from core objects in GraphQL endpoints (#12977)

Moves system-level operations (auth, billing, admin) to use the
/metadata endpoint instead of /graphql.

This cleans up the endpoint separation so /graphql is purely for core
objects (Company, People, etc.) and /metadata handles all system
operations.

Part of prep work for webhook/API key core migration.
This commit is contained in:
nitin
2025-07-01 21:59:32 +05:30
committed by GitHub
parent 76c517aa29
commit d2ddd6f473
229 changed files with 9425 additions and 8804 deletions
@@ -2,7 +2,7 @@ import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
import { expect } from '@storybook/jest';
import type { Meta, StoryObj } from '@storybook/react';
import { within } from '@storybook/testing-library';
import { FieldMetadataType } from '~/generated/graphql';
import { FieldMetadataType } from '~/generated-metadata/graphql';
import { WorkflowFieldsMultiSelect } from '../WorkflowEditUpdateEventFieldsMultiSelect';
const meta: Meta<typeof WorkflowFieldsMultiSelect> = {
@@ -3,10 +3,9 @@ import { renderHook } from '@testing-library/react';
import { ComputeStepOutputSchemaInput } from '~/generated/graphql';
import { useComputeStepOutputSchema } from '../useComputeStepOutputSchema';
jest.mock('@apollo/client', () => ({
...jest.requireActual('@apollo/client'),
useMutation: jest.fn(),
useApolloClient: () => ({}),
jest.mock('@apollo/client');
jest.mock('@/object-metadata/hooks/useApolloCoreClient', () => ({
useApolloCoreClient: () => ({}),
}));
describe('useComputeStepOutputSchema', () => {
@@ -1,24 +1,25 @@
import { useApolloClient, useMutation } from '@apollo/client';
import { useMutation } from '@apollo/client';
import { triggerUpdateRecordOptimisticEffect } from '@/apollo/optimistic-effect/utils/triggerUpdateRecordOptimisticEffect';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
import { modifyRecordFromCache } from '@/object-record/cache/utils/modifyRecordFromCache';
import { ACTIVATE_WORKFLOW_VERSION } from '@/workflow/graphql/mutations/activateWorkflowVersion';
import { WorkflowVersion } from '@/workflow/types/Workflow';
import { isDefined } from 'twenty-shared/utils';
import {
ActivateWorkflowVersionMutation,
ActivateWorkflowVersionMutationVariables,
} from '~/generated/graphql';
import { isDefined } from 'twenty-shared/utils';
} from '~/generated-metadata/graphql';
export const useActivateWorkflowVersion = () => {
const apolloClient = useApolloClient();
const apolloCoreClient = useApolloCoreClient();
const [mutate] = useMutation<
ActivateWorkflowVersionMutation,
ActivateWorkflowVersionMutationVariables
>(ACTIVATE_WORKFLOW_VERSION, {
client: apolloClient,
client: apolloCoreClient,
});
const { objectMetadataItem: objectMetadataItemWorkflowVersion } =
@@ -39,7 +40,7 @@ export const useActivateWorkflowVersion = () => {
},
update: () => {
modifyRecordFromCache({
cache: apolloClient.cache,
cache: apolloCoreClient.cache,
recordId: workflowVersionId,
objectMetadataItem: objectMetadataItemWorkflowVersion,
fieldModifiers: {
@@ -47,7 +48,7 @@ export const useActivateWorkflowVersion = () => {
},
});
const cacheSnapshot = apolloClient.cache.extract();
const cacheSnapshot = apolloCoreClient.cache.extract();
const allWorkflowVersions: Array<WorkflowVersion> = Object.values(
cacheSnapshot,
).filter(
@@ -67,7 +68,7 @@ export const useActivateWorkflowVersion = () => {
if (isDefined(newlyActiveWorkflowVersion)) {
triggerUpdateRecordOptimisticEffect({
cache: apolloClient.cache,
cache: apolloCoreClient.cache,
objectMetadataItem: objectMetadataItemWorkflowVersion,
currentRecord: newlyActiveWorkflowVersion,
updatedRecord: {
@@ -79,8 +80,8 @@ export const useActivateWorkflowVersion = () => {
}
for (const workflowVersion of previousActiveWorkflowVersions) {
apolloClient.cache.modify({
id: apolloClient.cache.identify(workflowVersion),
apolloCoreClient.cache.modify({
id: apolloCoreClient.cache.identify(workflowVersion),
fields: {
status: () => {
return workflowVersion.id !== workflowVersionId &&
@@ -92,7 +93,7 @@ export const useActivateWorkflowVersion = () => {
});
triggerUpdateRecordOptimisticEffect({
cache: apolloClient.cache,
cache: apolloCoreClient.cache,
objectMetadataItem: objectMetadataItemWorkflowVersion,
currentRecord: workflowVersion,
updatedRecord: {
@@ -1,18 +1,19 @@
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { COMPUTE_STEP_OUTPUT_SCHEMA } from '@/workflow/graphql/mutations/computeStepOutputSchema';
import { useApolloClient, useMutation } from '@apollo/client';
import { useMutation } from '@apollo/client';
import {
ComputeStepOutputSchemaInput,
ComputeStepOutputSchemaMutation,
ComputeStepOutputSchemaMutationVariables,
} from '~/generated/graphql';
} from '~/generated-metadata/graphql';
export const useComputeStepOutputSchema = () => {
const apolloClient = useApolloClient();
const apolloCoreClient = useApolloCoreClient();
const [mutate] = useMutation<
ComputeStepOutputSchemaMutation,
ComputeStepOutputSchemaMutationVariables
>(COMPUTE_STEP_OUTPUT_SCHEMA, {
client: apolloClient,
client: apolloCoreClient,
});
const computeStepOutputSchema = async (
@@ -1,16 +1,16 @@
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
import { useFindManyRecordsQuery } from '@/object-record/hooks/useFindManyRecordsQuery';
import { useApolloClient } from '@apollo/client';
import {
CreateDraftFromWorkflowVersionInput,
useCreateDraftFromWorkflowVersionMutation,
} from '~/generated/graphql';
} from '~/generated-metadata/graphql';
export const useCreateDraftFromWorkflowVersion = () => {
const apolloClient = useApolloClient();
const apolloCoreClient = useApolloCoreClient();
const [mutate] = useCreateDraftFromWorkflowVersionMutation({
client: apolloClient,
client: apolloCoreClient,
});
const { findManyRecordsQuery: findManyWorkflowsQuery } =
@@ -1,24 +1,25 @@
import { useApolloClient, useMutation } from '@apollo/client';
import { useMutation } from '@apollo/client';
import { triggerUpdateRecordOptimisticEffect } from '@/apollo/optimistic-effect/utils/triggerUpdateRecordOptimisticEffect';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
import { modifyRecordFromCache } from '@/object-record/cache/utils/modifyRecordFromCache';
import { DEACTIVATE_WORKFLOW_VERSION } from '@/workflow/graphql/mutations/deactivateWorkflowVersion';
import { WorkflowVersion } from '@/workflow/types/Workflow';
import { isDefined } from 'twenty-shared/utils';
import {
DeactivateWorkflowVersionMutation,
DeactivateWorkflowVersionMutationVariables,
} from '~/generated/graphql';
import { isDefined } from 'twenty-shared/utils';
} from '~/generated-metadata/graphql';
export const useDeactivateWorkflowVersion = () => {
const apolloClient = useApolloClient();
const apolloCoreClient = useApolloCoreClient();
const [mutate] = useMutation<
DeactivateWorkflowVersionMutation,
DeactivateWorkflowVersionMutationVariables
>(DEACTIVATE_WORKFLOW_VERSION, {
client: apolloClient,
client: apolloCoreClient,
});
const { objectMetadataItem: objectMetadataItemWorkflowVersion } =
@@ -37,7 +38,7 @@ export const useDeactivateWorkflowVersion = () => {
},
update: () => {
modifyRecordFromCache({
cache: apolloClient.cache,
cache: apolloCoreClient.cache,
recordId: workflowVersionId,
objectMetadataItem: objectMetadataItemWorkflowVersion,
fieldModifiers: {
@@ -45,7 +46,7 @@ export const useDeactivateWorkflowVersion = () => {
},
});
const cacheSnapshot = apolloClient.cache.extract();
const cacheSnapshot = apolloCoreClient.cache.extract();
const workflowVersion: WorkflowVersion | undefined = Object.values(
cacheSnapshot,
).find(
@@ -59,7 +60,7 @@ export const useDeactivateWorkflowVersion = () => {
}
triggerUpdateRecordOptimisticEffect({
cache: apolloClient.cache,
cache: apolloCoreClient.cache,
objectMetadataItem: objectMetadataItemWorkflowVersion,
currentRecord: workflowVersion,
updatedRecord: {
@@ -1,12 +1,12 @@
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
import { useGetRecordFromCache } from '@/object-record/cache/hooks/useGetRecordFromCache';
import { useDeleteOneRecord } from '@/object-record/hooks/useDeleteOneRecord';
import { Workflow, WorkflowVersion } from '@/workflow/types/Workflow';
import { useApolloClient } from '@apollo/client';
import { isDefined } from 'twenty-shared/utils';
export const useDeleteOneWorkflowVersion = () => {
const apolloClient = useApolloClient();
const apolloCoreClient = useApolloCoreClient();
const { deleteOneRecord } = useDeleteOneRecord({
objectNameSingular: CoreObjectNameSingular.WorkflowVersion,
});
@@ -39,8 +39,8 @@ export const useDeleteOneWorkflowVersion = () => {
return;
}
apolloClient.cache.modify({
id: apolloClient.cache.identify(cachedWorkflow),
apolloCoreClient.cache.modify({
id: apolloCoreClient.cache.identify(cachedWorkflow),
fields: {
versions: () => {
return cachedWorkflow.versions.filter(
@@ -1,3 +1,4 @@
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
@@ -6,17 +7,17 @@ import { updateRecordFromCache } from '@/object-record/cache/utils/updateRecordF
import { useObjectPermissions } from '@/object-record/hooks/useObjectPermissions';
import { DELETE_WORKFLOW_VERSION_STEP } from '@/workflow/graphql/mutations/deleteWorkflowVersionStep';
import { WorkflowVersion } from '@/workflow/types/Workflow';
import { useApolloClient, useMutation } from '@apollo/client';
import { useMutation } from '@apollo/client';
import { isDefined } from 'twenty-shared/utils';
import {
DeleteWorkflowVersionStepInput,
DeleteWorkflowVersionStepMutation,
DeleteWorkflowVersionStepMutationVariables,
WorkflowAction,
} from '~/generated/graphql';
} from '~/generated-metadata/graphql';
export const useDeleteWorkflowVersionStep = () => {
const apolloClient = useApolloClient();
const apolloCoreClient = useApolloCoreClient();
const { objectMetadataItems } = useObjectMetadataItems();
const { objectPermissionsByObjectMetadataId } = useObjectPermissions();
const { objectMetadataItem } = useObjectMetadataItem({
@@ -29,7 +30,7 @@ export const useDeleteWorkflowVersionStep = () => {
DeleteWorkflowVersionStepMutation,
DeleteWorkflowVersionStepMutationVariables
>(DELETE_WORKFLOW_VERSION_STEP, {
client: apolloClient,
client: apolloCoreClient,
});
const deleteWorkflowVersionStep = async (
input: DeleteWorkflowVersionStepInput,
@@ -80,7 +81,7 @@ export const useDeleteWorkflowVersionStep = () => {
updateRecordFromCache({
objectMetadataItems,
objectMetadataItem,
cache: apolloClient.cache,
cache: apolloCoreClient.cache,
record: newCachedRecord,
recordGqlFields,
objectPermissionsByObjectMetadataId,
@@ -1,4 +1,5 @@
import { useWorkflowCommandMenu } from '@/command-menu/hooks/useWorkflowCommandMenu';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadataItemsState';
import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
import { getRecordFromCache } from '@/object-record/cache/utils/getRecordFromCache';
@@ -13,13 +14,12 @@ import { workflowRunDiagramAutomaticallyOpenedStepsComponentState } from '@/work
import { workflowSelectedNodeComponentState } from '@/workflow/workflow-diagram/states/workflowSelectedNodeComponentState';
import { generateWorkflowRunDiagram } from '@/workflow/workflow-diagram/utils/generateWorkflowRunDiagram';
import { getWorkflowNodeIconKey } from '@/workflow/workflow-diagram/utils/getWorkflowNodeIconKey';
import { useApolloClient } from '@apollo/client';
import { useRecoilCallback } from 'recoil';
import { isDefined } from 'twenty-shared/utils';
import { useIcons } from 'twenty-ui/display';
export const useRunWorkflowRunOpeningInCommandMenuSideEffects = () => {
const apolloClient = useApolloClient();
const apolloCoreClient = useApolloCoreClient();
const { openWorkflowRunViewStepInCommandMenu } = useWorkflowCommandMenu();
const { getIcon } = useIcons();
@@ -41,7 +41,7 @@ export const useRunWorkflowRunOpeningInCommandMenuSideEffects = () => {
const workflowRunRecord = getRecordFromCache<WorkflowRun>({
objectMetadataItem,
cache: apolloClient.cache,
cache: apolloCoreClient.cache,
recordId,
objectMetadataItems,
objectPermissionsByObjectMetadataId,
@@ -117,7 +117,7 @@ export const useRunWorkflowRunOpeningInCommandMenuSideEffects = () => {
});
},
[
apolloClient.cache,
apolloCoreClient.cache,
getIcon,
openWorkflowRunViewStepInCommandMenu,
objectPermissionsByObjectMetadataId,
@@ -1,6 +1,7 @@
import { triggerCreateRecordsOptimisticEffect } from '@/apollo/optimistic-effect/utils/triggerCreateRecordsOptimisticEffect';
import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
import { useOpenRecordInCommandMenu } from '@/command-menu/hooks/useOpenRecordInCommandMenu';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
@@ -15,17 +16,17 @@ import { computeOptimisticCreateRecordBaseRecordInput } from '@/object-record/ut
import { computeOptimisticRecordFromInput } from '@/object-record/utils/computeOptimisticRecordFromInput';
import { RUN_WORKFLOW_VERSION } from '@/workflow/graphql/mutations/runWorkflowVersion';
import { WorkflowRun } from '@/workflow/types/Workflow';
import { useApolloClient, useMutation } from '@apollo/client';
import { useMutation } from '@apollo/client';
import { useRecoilCallback, useRecoilValue } from 'recoil';
import { isDefined } from 'twenty-shared/utils';
import { v4 } from 'uuid';
import {
RunWorkflowVersionMutation,
RunWorkflowVersionMutationVariables,
} from '~/generated/graphql';
} from '~/generated-metadata/graphql';
export const useRunWorkflowVersion = () => {
const apolloClient = useApolloClient();
const apolloCoreClient = useApolloCoreClient();
const { objectMetadataItem } = useObjectMetadataItem({
objectNameSingular: CoreObjectNameSingular.WorkflowRun,
@@ -42,7 +43,7 @@ export const useRunWorkflowVersion = () => {
RunWorkflowVersionMutation,
RunWorkflowVersionMutationVariables
>(RUN_WORKFLOW_VERSION, {
client: apolloClient,
client: apolloCoreClient,
});
const computedRecordGqlFields = generateDepthOneRecordGqlFields({
@@ -87,7 +88,7 @@ export const useRunWorkflowVersion = () => {
};
const optimisticRecordInput = computeOptimisticRecordFromInput({
cache: apolloClient.cache,
cache: apolloCoreClient.cache,
currentWorkspaceMember: currentWorkspaceMember,
objectMetadataItem,
objectMetadataItems,
@@ -122,7 +123,7 @@ export const useRunWorkflowVersion = () => {
});
triggerCreateRecordsOptimisticEffect({
cache: apolloClient.cache,
cache: apolloCoreClient.cache,
objectMetadataItem,
recordsToCreate: [recordNodeCreatedInCache],
objectMetadataItems,
@@ -1,4 +1,4 @@
import { FieldMetadataType } from '~/generated/graphql';
import { FieldMetadataType } from '~/generated-metadata/graphql';
export type InputSchemaPropertyType =
| 'string'
@@ -1,3 +1,4 @@
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
@@ -6,16 +7,16 @@ import { updateRecordFromCache } from '@/object-record/cache/utils/updateRecordF
import { useObjectPermissions } from '@/object-record/hooks/useObjectPermissions';
import { CREATE_WORKFLOW_VERSION_STEP } from '@/workflow/graphql/mutations/createWorkflowVersionStep';
import { WorkflowVersion } from '@/workflow/types/Workflow';
import { useApolloClient, useMutation } from '@apollo/client';
import { useMutation } from '@apollo/client';
import { isDefined } from 'twenty-shared/utils';
import {
CreateWorkflowVersionStepInput,
CreateWorkflowVersionStepMutation,
CreateWorkflowVersionStepMutationVariables,
} from '~/generated/graphql';
} from '~/generated-metadata/graphql';
export const useCreateWorkflowVersionStep = () => {
const apolloClient = useApolloClient();
const apolloCoreClient = useApolloCoreClient();
const { objectMetadataItems } = useObjectMetadataItems();
const { objectPermissionsByObjectMetadataId } = useObjectPermissions();
const { objectMetadataItem } = useObjectMetadataItem({
@@ -28,7 +29,7 @@ export const useCreateWorkflowVersionStep = () => {
CreateWorkflowVersionStepMutation,
CreateWorkflowVersionStepMutationVariables
>(CREATE_WORKFLOW_VERSION_STEP, {
client: apolloClient,
client: apolloCoreClient,
});
const createWorkflowVersionStep = async (
input: CreateWorkflowVersionStepInput,
@@ -83,7 +84,7 @@ export const useCreateWorkflowVersionStep = () => {
updateRecordFromCache({
objectMetadataItems,
objectMetadataItem,
cache: apolloClient.cache,
cache: apolloCoreClient.cache,
record: newCachedRecord,
recordGqlFields,
objectPermissionsByObjectMetadataId,
@@ -1,3 +1,4 @@
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
@@ -6,17 +7,17 @@ import { updateRecordFromCache } from '@/object-record/cache/utils/updateRecordF
import { useObjectPermissions } from '@/object-record/hooks/useObjectPermissions';
import { UPDATE_WORKFLOW_RUN_STEP } from '@/workflow/graphql/mutations/updateWorkflowRunStep';
import { WorkflowRun } from '@/workflow/types/Workflow';
import { useApolloClient, useMutation } from '@apollo/client';
import { useMutation } from '@apollo/client';
import { isDefined } from 'twenty-shared/utils';
import {
UpdateWorkflowRunStepInput,
UpdateWorkflowRunStepMutation,
UpdateWorkflowRunStepMutationVariables,
WorkflowAction,
} from '~/generated/graphql';
} from '~/generated-metadata/graphql';
export const useUpdateWorkflowRunStep = () => {
const apolloClient = useApolloClient();
const apolloCoreClient = useApolloCoreClient();
const { objectMetadataItems } = useObjectMetadataItems();
const { objectMetadataItem } = useObjectMetadataItem({
objectNameSingular: CoreObjectNameSingular.WorkflowRun,
@@ -26,7 +27,7 @@ export const useUpdateWorkflowRunStep = () => {
UpdateWorkflowRunStepMutation,
UpdateWorkflowRunStepMutationVariables
>(UPDATE_WORKFLOW_RUN_STEP, {
client: apolloClient,
client: apolloCoreClient,
});
const getRecordFromCache = useGetRecordFromCache({
@@ -75,7 +76,7 @@ export const useUpdateWorkflowRunStep = () => {
updateRecordFromCache({
objectMetadataItems,
objectMetadataItem,
cache: apolloClient.cache,
cache: apolloCoreClient.cache,
record: newCachedRecord,
recordGqlFields,
objectPermissionsByObjectMetadataId,
@@ -1,3 +1,4 @@
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
@@ -6,17 +7,17 @@ import { updateRecordFromCache } from '@/object-record/cache/utils/updateRecordF
import { useObjectPermissions } from '@/object-record/hooks/useObjectPermissions';
import { UPDATE_WORKFLOW_VERSION_STEP } from '@/workflow/graphql/mutations/updateWorkflowVersionStep';
import { WorkflowVersion } from '@/workflow/types/Workflow';
import { useApolloClient, useMutation } from '@apollo/client';
import { useMutation } from '@apollo/client';
import { isDefined } from 'twenty-shared/utils';
import {
UpdateWorkflowVersionStepInput,
UpdateWorkflowVersionStepMutation,
UpdateWorkflowVersionStepMutationVariables,
WorkflowAction,
} from '~/generated/graphql';
} from '~/generated-metadata/graphql';
export const useUpdateWorkflowVersionStep = () => {
const apolloClient = useApolloClient();
const apolloCoreClient = useApolloCoreClient();
const { objectMetadataItems } = useObjectMetadataItems();
const { objectPermissionsByObjectMetadataId } = useObjectPermissions();
@@ -30,7 +31,7 @@ export const useUpdateWorkflowVersionStep = () => {
UpdateWorkflowVersionStepMutation,
UpdateWorkflowVersionStepMutationVariables
>(UPDATE_WORKFLOW_VERSION_STEP, {
client: apolloClient,
client: apolloCoreClient,
});
const updateWorkflowVersionStep = async (
@@ -65,7 +66,7 @@ export const useUpdateWorkflowVersionStep = () => {
updateRecordFromCache({
objectMetadataItems,
objectMetadataItem,
cache: apolloClient.cache,
cache: apolloCoreClient.cache,
record: newCachedRecord,
recordGqlFields,
objectPermissionsByObjectMetadataId,
@@ -5,7 +5,7 @@ import {
useFindOneAgentQuery,
useGetRolesQuery,
useRemoveRoleFromAgentMutation,
} from '~/generated/graphql';
} from '~/generated-metadata/graphql';
export const useAgentRoleAssignment = (agentId: string) => {
const [workflowAiAgentSelectedRole, setWorkflowAiAgentSelectedRole] =
@@ -2,7 +2,7 @@ import { useMutation } from '@apollo/client';
import { useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { useDebouncedCallback } from 'use-debounce';
import { useFindOneAgentQuery } from '~/generated/graphql';
import { useFindOneAgentQuery } from '~/generated-metadata/graphql';
import { UPDATE_ONE_AGENT } from '../graphql/mutations/updateOneAgent';
type AgentFormValues = {
@@ -1,20 +1,21 @@
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
import { useFindOneRecordQuery } from '@/object-record/hooks/useFindOneRecordQuery';
import { SUBMIT_FORM_STEP } from '@/workflow/workflow-steps/workflow-actions/form-action/graphql/mutations/submitFormStep';
import { useApolloClient, useMutation } from '@apollo/client';
import { useMutation } from '@apollo/client';
import {
SubmitFormStepInput,
SubmitFormStepMutation,
SubmitFormStepMutationVariables,
} from '~/generated/graphql';
} from '~/generated-metadata/graphql';
export const useSubmitFormStep = () => {
const apolloClient = useApolloClient();
const apolloCoreClient = useApolloCoreClient();
const [mutate] = useMutation<
SubmitFormStepMutation,
SubmitFormStepMutationVariables
>(SUBMIT_FORM_STEP, {
client: apolloClient,
client: apolloCoreClient,
});
const { findOneRecordQuery: findOneWorkflowRunQuery } = useFindOneRecordQuery(
@@ -1,7 +1,7 @@
import { CustomError } from '@/error-handler/CustomError';
import { FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import { WorkflowActionType } from '@/workflow/types/Workflow';
import { FieldMetadataType } from '~/generated/graphql';
import { FieldMetadataType } from '~/generated-metadata/graphql';
const COMMON_DISPLAYABLE_FIELD_TYPES = [
FieldMetadataType.TEXT,
@@ -1,6 +1,6 @@
import { StepOutputSchema } from '@/workflow/workflow-variables/types/StepOutputSchema';
import { searchVariableThroughOutputSchema } from '@/workflow/workflow-variables/utils/searchVariableThroughOutputSchema';
import { FieldMetadataType } from '~/generated/graphql';
import { FieldMetadataType } from '~/generated-metadata/graphql';
describe('searchVariableThroughOutputSchema', () => {
describe('step tests', () => {