Reduce leak between gql schema (#17878)

## Reduce type leakage between GraphQL schemas

### Why

Twenty runs two separate GraphQL schemas: **core** and **metadata**.
NestJS's `@nestjs/graphql` uses a global `TypeMetadataStorage` that
accumulates all decorated types across all modules. When each schema is
built, every registered type leaks into both schemas regardless of which
module it belongs to.

This means the core schema's generated TypeScript
(`generated/graphql.ts`) contained ~2,700 lines of types that only
belong to the metadata schema (and vice versa). This creates confusion
about type ownership, inflates generated code, and makes it harder to
reason about which API surface each schema actually exposes.

### How

**1. Patch `@nestjs/graphql` to support schema-scoped type resolution**

- **(Already done)** Added a `resolverSchemaScope` option to
`GqlModuleOptions`, allowing each schema to declare a scope (e.g.
`'metadata'`)
- `ResolversExplorerService` now filters resolvers by a
`RESOLVER_SCHEMA_SCOPE` metadata key, so each schema only sees its own
resolvers
- `GraphQLSchemaFactory` now performs a **reachability walk**
(`computeReachableTypes`) starting from scoped resolver return types and
arguments, only including types that are transitively referenced —
handling unions, interfaces, and prototype chains
- Type definition storage and orphaned reference registry are cleared
between schema builds to prevent cross-contamination

**2. Register `ClientConfig` as orphaned type in metadata schema**

Since `ClientConfig` is needed in the metadata schema but not directly
returned by a resolver, it's explicitly declared via
`buildSchemaOptions.orphanedTypes`.

**3. Regenerate frontend types and fix imports**

- `generated/graphql.ts` shrank by ~2,700 lines (types moved to where
they belong)
- `generated-metadata/graphql.ts` gained types like `ClientConfig` that
were previously missing
- ~500 frontend files updated to import from the correct generated file
This commit is contained in:
Charles Bochet
2026-02-12 10:58:52 +01:00
committed by GitHub
parent fe1ec6fd04
commit b456f79167
517 changed files with 999 additions and 3440 deletions
@@ -271,14 +271,6 @@ export type AppToken = {
updatedAt: Scalars['DateTime'];
};
export type AppTokenEdge = {
__typename?: 'AppTokenEdge';
/** Cursor for this node. */
cursor: Scalars['ConnectionCursor'];
/** The node containing the AppToken */
node: AppToken;
};
export type Application = {
__typename?: 'Application';
agents: Array<Agent>;
@@ -649,11 +641,6 @@ export type BooleanFieldComparison = {
isNot?: InputMaybe<Scalars['Boolean']>;
};
export enum CalendarChannelVisibility {
METADATA = 'METADATA',
SHARE_EVERYTHING = 'SHARE_EVERYTHING'
}
export type CalendarConfiguration = {
__typename?: 'CalendarConfiguration';
configurationType: WidgetConfigurationType;
@@ -693,6 +680,38 @@ export type ClientAiModelConfig = {
provider: ModelProvider;
};
export type ClientConfig = {
__typename?: 'ClientConfig';
aiModels: Array<ClientAiModelConfig>;
allowRequestsToTwentyIcons: Scalars['Boolean'];
analyticsEnabled: Scalars['Boolean'];
api: ApiConfig;
appVersion?: Maybe<Scalars['String']>;
authProviders: AuthProviders;
billing: Billing;
calendarBookingPageId?: Maybe<Scalars['String']>;
canManageFeatureFlags: Scalars['Boolean'];
captcha: Captcha;
chromeExtensionId?: Maybe<Scalars['String']>;
defaultSubdomain?: Maybe<Scalars['String']>;
frontDomain: Scalars['String'];
isAttachmentPreviewEnabled: Scalars['Boolean'];
isClickHouseConfigured: Scalars['Boolean'];
isCloudflareIntegrationEnabled: Scalars['Boolean'];
isConfigVariablesInDbEnabled: Scalars['Boolean'];
isEmailVerificationRequired: Scalars['Boolean'];
isGoogleCalendarEnabled: Scalars['Boolean'];
isGoogleMessagingEnabled: Scalars['Boolean'];
isImapSmtpCaldavEnabled: Scalars['Boolean'];
isMicrosoftCalendarEnabled: Scalars['Boolean'];
isMicrosoftMessagingEnabled: Scalars['Boolean'];
isMultiWorkspaceEnabled: Scalars['Boolean'];
publicFeatureFlags: Array<PublicFeatureFlag>;
sentry: Sentry;
signInPrefilled: Scalars['Boolean'];
support: Support;
};
export type CommandMenuItem = {
__typename?: 'CommandMenuItem';
applicationId?: Maybe<Scalars['UUID']>;
@@ -1927,19 +1946,6 @@ export type LineChartSeries = {
label: Scalars['String'];
};
export type LinkMetadata = {
__typename?: 'LinkMetadata';
label: Scalars['String'];
url: Scalars['String'];
};
export type LinksMetadata = {
__typename?: 'LinksMetadata';
primaryLinkLabel: Scalars['String'];
primaryLinkUrl: Scalars['String'];
secondaryLinks?: Maybe<Array<LinkMetadata>>;
};
export type Location = {
__typename?: 'Location';
lat?: Maybe<Scalars['Float']>;
@@ -2029,12 +2035,6 @@ export type MarketplaceApp = {
websiteUrl?: Maybe<Scalars['String']>;
};
export enum MessageChannelVisibility {
METADATA = 'METADATA',
SHARE_EVERYTHING = 'SHARE_EVERYTHING',
SUBJECT = 'SUBJECT'
}
export enum ModelProvider {
ANTHROPIC = 'ANTHROPIC',
GROQ = 'GROQ',
@@ -4141,29 +4141,6 @@ export enum SsoIdentityProviderStatus {
Inactive = 'Inactive'
}
export type SearchRecord = {
__typename?: 'SearchRecord';
imageUrl?: Maybe<Scalars['String']>;
label: Scalars['String'];
objectLabelSingular: Scalars['String'];
objectNameSingular: Scalars['String'];
recordId: Scalars['UUID'];
tsRank: Scalars['Float'];
tsRankCD: Scalars['Float'];
};
export type SearchResultEdge = {
__typename?: 'SearchResultEdge';
cursor: Scalars['String'];
node: SearchRecord;
};
export type SearchResultPageInfo = {
__typename?: 'SearchResultPageInfo';
endCursor?: Maybe<Scalars['String']>;
hasNextPage: Scalars['Boolean'];
};
export type SendInvitationsOutput = {
__typename?: 'SendInvitationsOutput';
errors: Array<Scalars['String']>;
@@ -4311,63 +4288,11 @@ export type TasksConfiguration = {
configurationType: WidgetConfigurationType;
};
export type TimelineCalendarEvent = {
__typename?: 'TimelineCalendarEvent';
conferenceLink: LinksMetadata;
conferenceSolution: Scalars['String'];
description: Scalars['String'];
endsAt: Scalars['DateTime'];
id: Scalars['UUID'];
isCanceled: Scalars['Boolean'];
isFullDay: Scalars['Boolean'];
location: Scalars['String'];
participants: Array<TimelineCalendarEventParticipant>;
startsAt: Scalars['DateTime'];
title: Scalars['String'];
visibility: CalendarChannelVisibility;
};
export type TimelineCalendarEventParticipant = {
__typename?: 'TimelineCalendarEventParticipant';
avatarUrl: Scalars['String'];
displayName: Scalars['String'];
firstName: Scalars['String'];
handle: Scalars['String'];
lastName: Scalars['String'];
personId?: Maybe<Scalars['UUID']>;
workspaceMemberId?: Maybe<Scalars['UUID']>;
};
export type TimelineConfiguration = {
__typename?: 'TimelineConfiguration';
configurationType: WidgetConfigurationType;
};
export type TimelineThread = {
__typename?: 'TimelineThread';
firstParticipant: TimelineThreadParticipant;
id: Scalars['UUID'];
lastMessageBody: Scalars['String'];
lastMessageReceivedAt: Scalars['DateTime'];
lastTwoParticipants: Array<TimelineThreadParticipant>;
numberOfMessagesInThread: Scalars['Float'];
participantCount: Scalars['Float'];
read: Scalars['Boolean'];
subject: Scalars['String'];
visibility: MessageChannelVisibility;
};
export type TimelineThreadParticipant = {
__typename?: 'TimelineThreadParticipant';
avatarUrl: Scalars['String'];
displayName: Scalars['String'];
firstName: Scalars['String'];
handle: Scalars['String'];
lastName: Scalars['String'];
personId?: Maybe<Scalars['UUID']>;
workspaceMemberId?: Maybe<Scalars['UUID']>;
};
export type ToolIndexEntry = {
__typename?: 'ToolIndexEntry';
category: Scalars['String'];
@@ -4782,14 +4707,6 @@ export type User = {
workspaces: Array<UserWorkspace>;
};
export type UserEdge = {
__typename?: 'UserEdge';
/** Cursor for this node. */
cursor: Scalars['ConnectionCursor'];
/** The node containing the User */
node: User;
};
export type UserInfo = {
__typename?: 'UserInfo';
email: Scalars['String'];
@@ -4998,12 +4915,6 @@ export type WorkflowRunConfiguration = {
configurationType: WidgetConfigurationType;
};
export type WorkflowStepPosition = {
__typename?: 'WorkflowStepPosition';
x: Scalars['Float'];
y: Scalars['Float'];
};
export type WorkflowVersionConfiguration = {
__typename?: 'WorkflowVersionConfiguration';
configurationType: WidgetConfigurationType;
@@ -5068,14 +4979,6 @@ export enum WorkspaceActivationStatus {
SUSPENDED = 'SUSPENDED'
}
export type WorkspaceEdge = {
__typename?: 'WorkspaceEdge';
/** Cursor for this node. */
cursor: Scalars['ConnectionCursor'];
/** The node containing the Workspace */
node: Workspace;
};
export type WorkspaceInfo = {
__typename?: 'WorkspaceInfo';
allowImpersonation: Scalars['Boolean'];
File diff suppressed because it is too large Load Diff
@@ -7,7 +7,7 @@ import { useRecoilValue } from 'recoil';
import { AppPath, SettingsPath } from 'twenty-shared/types';
import { getSettingsPath } from 'twenty-shared/utils';
import { OnboardingStatus } from '~/generated/graphql';
import { OnboardingStatus } from '~/generated-metadata/graphql';
import { useIsCurrentLocationOnAWorkspace } from '@/domain-manager/hooks/useIsCurrentLocationOnAWorkspace';
import { usePageChangeEffectNavigateLocation } from '~/hooks/usePageChangeEffectNavigateLocation';
@@ -11,7 +11,7 @@ import { useRecoilValue } from 'recoil';
import { AppPath, SettingsPath } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { WorkspaceActivationStatus } from 'twenty-shared/workspace';
import { OnboardingStatus } from '~/generated/graphql';
import { OnboardingStatus } from '~/generated-metadata/graphql';
import { isMatchingLocation } from '~/utils/isMatchingLocation';
export const usePageChangeEffectNavigateLocation = () => {
@@ -66,8 +66,10 @@ import {
} from 'twenty-ui/display';
import { isDefined } from 'twenty-shared/utils';
import { PermissionFlagType } from '~/generated-metadata/graphql';
import { FeatureFlagKey } from '~/generated/graphql';
import {
PermissionFlagType,
FeatureFlagKey,
} from '~/generated-metadata/graphql';
export const DEFAULT_RECORD_ACTIONS_CONFIG: Record<
| NoSelectionRecordActionKeys
@@ -7,7 +7,7 @@ import { recordStoreFamilyState } from '@/object-record/record-store/states/reco
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
import { useRecoilValue } from 'recoil';
import { isDefined } from 'twenty-shared/utils';
import { FeatureFlagKey } from '~/generated/graphql';
import { FeatureFlagKey } from '~/generated-metadata/graphql';
export const AddToFavoritesSingleRecordAction = () => {
const { objectMetadataItem } = useContextStoreObjectMetadataItemOrThrow();
@@ -10,7 +10,7 @@ import { useRecordIndexIdFromCurrentContextStore } from '@/object-record/record-
import { useResetTableRowSelection } from '@/object-record/record-table/hooks/internal/useResetTableRowSelection';
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
import { isDefined } from 'twenty-shared/utils';
import { FeatureFlagKey } from '~/generated/graphql';
import { FeatureFlagKey } from '~/generated-metadata/graphql';
export const DeleteSingleRecordAction = () => {
const { recordIndexId, objectMetadataItem } =
@@ -7,7 +7,7 @@ import { useDeleteNavigationMenuItem } from '@/navigation-menu-item/hooks/useDel
import { usePrefetchedNavigationMenuItemsData } from '@/navigation-menu-item/hooks/usePrefetchedNavigationMenuItemsData';
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
import { isDefined } from 'twenty-shared/utils';
import { FeatureFlagKey } from '~/generated/graphql';
import { FeatureFlagKey } from '~/generated-metadata/graphql';
export const RemoveFromFavoritesSingleRecordAction = () => {
const recordId = useSelectedRecordIdOrThrow();
@@ -2,7 +2,7 @@ import { RECORD_AGNOSTIC_ACTIONS_CONFIG } from '@/action-menu/actions/record-agn
import { RecordAgnosticActionsKeys } from '@/action-menu/actions/record-agnostic-actions/types/RecordAgnosticActionsKeys';
import { type ActionConfig } from '@/action-menu/actions/types/ActionConfig';
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
import { FeatureFlagKey } from '~/generated/graphql';
import { FeatureFlagKey } from '~/generated-metadata/graphql';
export const useRecordAgnosticActions = () => {
const isAiEnabled = useIsFeatureEnabled(FeatureFlagKey.IS_AI_ENABLED);
@@ -4,7 +4,7 @@ import { type RecordFilter } from '@/object-record/record-filter/types/RecordFil
import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
import { type WorkflowWithCurrentVersion } from '@/workflow/types/Workflow';
import { type ObjectPermissions } from 'twenty-shared/types';
import { type FeatureFlagKey } from '~/generated/graphql';
import { type FeatureFlagKey } from '~/generated-metadata/graphql';
export type ShouldBeRegisteredFunctionParams = {
objectMetadataItem?: ObjectMetadataItem;
@@ -20,7 +20,7 @@ import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
import { useContext, useMemo } from 'react';
import { useRecoilCallback, useRecoilValue } from 'recoil';
import { isDefined } from 'twenty-shared/utils';
import { FeatureFlagKey } from '~/generated/graphql';
import { FeatureFlagKey } from '~/generated-metadata/graphql';
export const useShouldActionBeRegisteredParams = ({
objectMetadataItem,
@@ -2,7 +2,7 @@ import { type CalendarEventParticipant } from '@/activities/calendar/types/Calen
import { isTimelineCalendarEventParticipant } from '@/activities/calendar/types/guards/IsTimelineCalendarEventParticipant';
import { isDefined } from 'twenty-shared/utils';
import { Avatar, AvatarGroup } from 'twenty-ui/display';
import { type TimelineCalendarEventParticipant } from '~/generated-metadata/graphql';
import { type TimelineCalendarEventParticipant } from '~/generated/graphql';
type CalendarEventParticipantsAvatarGroupProps = {
participants: CalendarEventParticipant[] | TimelineCalendarEventParticipant[];
@@ -3,6 +3,10 @@ import styled from '@emotion/styled';
import { t } from '@lingui/core/macro';
import { format } from 'date-fns';
import { useRecoilValue } from 'recoil';
import {
CalendarChannelVisibility,
type TimelineCalendarEvent,
} from '~/generated/graphql';
import { CalendarEventNotSharedContent } from '@/activities/calendar/components/CalendarEventNotSharedContent';
import { CalendarEventParticipantsAvatarGroup } from '@/activities/calendar/components/CalendarEventParticipantsAvatarGroup';
@@ -12,10 +16,6 @@ import { hasCalendarEventEnded } from '@/activities/calendar/utils/hasCalendarEv
import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
import { useOpenCalendarEventInCommandMenu } from '@/command-menu/hooks/useOpenCalendarEventInCommandMenu';
import { IconArrowRight } from 'twenty-ui/display';
import {
CalendarChannelVisibility,
type TimelineCalendarEvent,
} from '~/generated-metadata/graphql';
type CalendarEventRowProps = {
calendarEvent: TimelineCalendarEvent;
@@ -7,7 +7,7 @@ import { getTimelineCalendarEventsFromCompanyId } from '@/activities/calendar/gr
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
import { LayoutRenderingProvider } from '@/ui/layout/contexts/LayoutRenderingContext';
import { ComponentDecorator } from 'twenty-ui/testing';
import { PageLayoutType } from '~/generated/graphql';
import { PageLayoutType } from '~/generated-metadata/graphql';
import { ObjectMetadataItemsDecorator } from '~/testing/decorators/ObjectMetadataItemsDecorator';
import { SnackBarDecorator } from '~/testing/decorators/SnackBarDecorator';
import { graphqlMocks } from '~/testing/graphqlMocks';
@@ -1,5 +1,5 @@
import { type CalendarEventParticipant } from '@/activities/calendar/types/CalendarEventParticipant';
import { type TimelineCalendarEventParticipant } from '~/generated-metadata/graphql';
import { type TimelineCalendarEventParticipant } from '~/generated/graphql';
export const isTimelineCalendarEventParticipant = (
participant: CalendarEventParticipant | TimelineCalendarEventParticipant,
@@ -42,7 +42,7 @@ import '@blocknote/mantine/style.css';
import { useCreateBlockNote } from '@blocknote/react';
import '@blocknote/react/style.css';
import { isDefined } from 'twenty-shared/utils';
import { FeatureFlagKey } from '~/generated/graphql';
import { FeatureFlagKey } from '~/generated-metadata/graphql';
type ActivityRichTextEditorProps = {
activityId: string;
@@ -20,8 +20,10 @@ import { ScrollWrapper } from '@/ui/utilities/scroll/components/ScrollWrapper';
import { assertIsDefinedOrThrow } from 'twenty-shared/utils';
import { IconDownload, IconX } from 'twenty-ui/display';
import { IconButton } from 'twenty-ui/input';
import { PermissionFlagType } from '~/generated-metadata/graphql';
import { FeatureFlagKey } from '~/generated/graphql';
import {
PermissionFlagType,
FeatureFlagKey,
} from '~/generated-metadata/graphql';
import { AttachmentRow } from './AttachmentRow';
const DocumentViewer = lazy(() =>
@@ -22,8 +22,10 @@ import { useHasPermissionFlag } from '@/settings/roles/hooks/useHasPermissionFla
import { t } from '@lingui/core/macro';
import { IconCalendar, OverflowingTextWithTooltip } from 'twenty-ui/display';
import { isNavigationModifierPressed } from 'twenty-ui/utilities';
import { PermissionFlagType } from '~/generated-metadata/graphql';
import { FeatureFlagKey } from '~/generated/graphql';
import {
PermissionFlagType,
FeatureFlagKey,
} from '~/generated-metadata/graphql';
import { formatToHumanReadableDate } from '~/utils/date-utils';
import { getFileNameAndExtension } from '~/utils/file/getFileNameAndExtension';
@@ -4,7 +4,7 @@ import { getActivityTargetObjectFieldIdName } from '@/activities/utils/getActivi
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
import { useFindManyRecords } from '@/object-record/hooks/useFindManyRecords';
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
import { FeatureFlagKey } from '~/generated/graphql';
import { FeatureFlagKey } from '~/generated-metadata/graphql';
export const useAttachments = (targetableObject: ActivityTargetableObject) => {
const isAttachmentMigrated = useIsFeatureEnabled(
@@ -13,8 +13,9 @@ import {
FileFolder,
useUploadFileMutation,
useUploadFilesFieldFileMutation,
FeatureFlagKey,
FieldMetadataType,
} from '~/generated-metadata/graphql';
import { FeatureFlagKey, FieldMetadataType } from '~/generated/graphql';
export const useUploadAttachmentFile = () => {
const coreClient = useApolloCoreClient();
@@ -12,7 +12,7 @@ import { type ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataI
import { useFindManyRecords } from '@/object-record/hooks/useFindManyRecords';
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
import { FeatureFlagKey } from '~/generated/graphql';
import { FeatureFlagKey } from '~/generated-metadata/graphql';
export const useActivityTargetsForTargetableObjects = ({
objectNameSingular,
@@ -15,7 +15,7 @@ import { useObjectPermissions } from '@/object-record/hooks/useObjectPermissions
import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
import { isDefined } from 'twenty-shared/utils';
import { FeatureFlagKey } from '~/generated/graphql';
import { FeatureFlagKey } from '~/generated-metadata/graphql';
import { sortByAscString } from '~/utils/array/sortByAscString';
export const usePrepareFindManyActivitiesQuery = ({
@@ -15,7 +15,7 @@ import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
import { useRecoilCallback, useSetRecoilState } from 'recoil';
import { isDefined } from 'twenty-shared/utils';
import { v4 } from 'uuid';
import { FeatureFlagKey } from '~/generated/graphql';
import { FeatureFlagKey } from '~/generated-metadata/graphql';
type UpdateActivityTargetFromCellProps = {
recordPickerInstanceId: string;
@@ -6,7 +6,7 @@ import { TimelineActivityContext } from '@/activities/timeline-activities/contex
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
import { LayoutRenderingProvider } from '@/ui/layout/contexts/LayoutRenderingContext';
import { ComponentDecorator } from 'twenty-ui/testing';
import { PageLayoutType } from '~/generated/graphql';
import { PageLayoutType } from '~/generated-metadata/graphql';
import { ObjectMetadataItemsDecorator } from '~/testing/decorators/ObjectMetadataItemsDecorator';
import { SnackBarDecorator } from '~/testing/decorators/SnackBarDecorator';
import { mockedTimelineActivities } from '~/testing/mock-data/timeline-activities';
@@ -1,5 +1,5 @@
import { isDefined } from 'twenty-shared/utils';
import { type WorkspaceMember } from '~/generated/graphql';
import { type WorkspaceMember } from '~/generated-metadata/graphql';
export type TimelineActivity = {
id: string;
@@ -4,7 +4,7 @@ import { useAgentChat } from '@/ai/hooks/useAgentChat';
import { useAgentChatData } from '@/ai/hooks/useAgentChatData';
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
import { Suspense } from 'react';
import { FeatureFlagKey } from '~/generated/graphql';
import { FeatureFlagKey } from '~/generated-metadata/graphql';
const AgentChatProviderContent = ({
children,
@@ -1,6 +1,6 @@
import { mapDBPartToUIMessagePart } from '@/ai/utils/mapDBPartToUIMessagePart';
import { type ExtendedUIMessage } from 'twenty-shared/ai';
import { type AgentMessage } from '~/generated/graphql';
import { type AgentMessage } from '~/generated-metadata/graphql';
export const mapDBMessagesToUIMessages = (
dbMessages: AgentMessage[],
@@ -1,6 +1,6 @@
import { type ReasoningUIPart, type ToolUIPart } from 'ai';
import { type ExtendedUIMessagePart } from 'twenty-shared/ai';
import { type AgentMessagePart } from '~/generated/graphql';
import { type AgentMessagePart } from '~/generated-metadata/graphql';
export const mapDBPartToUIMessagePart = (
part: AgentMessagePart,
@@ -5,7 +5,7 @@ import { DEFAULT_FAST_MODEL } from '@/ai/constants/DefaultFastModel';
import { DEFAULT_SMART_MODEL } from '@/ai/constants/DefaultSmartModel';
import { ApolloFactory, type Options } from '@/apollo/services/apollo.factory';
import { CUSTOM_WORKSPACE_APPLICATION_MOCK } from '@/object-metadata/hooks/__tests__/constants/CustomWorkspaceApplicationMock.test.constant';
import { WorkspaceActivationStatus } from '~/generated/graphql';
import { WorkspaceActivationStatus } from '~/generated-metadata/graphql';
enableFetchMocks();
@@ -18,7 +18,7 @@ import { createUploadLink } from 'apollo-upload-client';
import { renewToken } from '@/auth/services/AuthService';
import { type CurrentWorkspaceMember } from '@/auth/states/currentWorkspaceMemberState';
import { type CurrentWorkspace } from '@/auth/states/currentWorkspaceState';
import { type AuthTokenPair } from '~/generated/graphql';
import { type AuthTokenPair } from '~/generated-metadata/graphql';
import { logDebug } from '~/utils/logDebug';
import { REST_API_BASE_URL } from '@/apollo/constant/rest-api-base-url';
@@ -1,5 +1,5 @@
import { isDefined } from 'twenty-shared/utils';
import { type AuthTokenPair } from '~/generated/graphql';
import { type AuthTokenPair } from '~/generated-metadata/graphql';
import { cookieStorage } from '~/utils/cookie-storage';
import { isValidAuthTokenPair } from './isValidAuthTokenPair';
@@ -1,4 +1,4 @@
import { type AuthTokenPair } from '~/generated/graphql';
import { type AuthTokenPair } from '~/generated-metadata/graphql';
export const isValidAuthTokenPair = (
tokenPair: any,
@@ -5,7 +5,10 @@ import { SettingsProtectedRouteWrapper } from '@/settings/components/SettingsPro
import { SettingsSkeletonLoader } from '@/settings/components/SettingsSkeletonLoader';
import { SettingPublicDomain } from '@/settings/domains/components/SettingPublicDomain';
import { SettingsPath } from 'twenty-shared/types';
import { FeatureFlagKey, PermissionFlagType } from '~/generated/graphql';
import {
FeatureFlagKey,
PermissionFlagType,
} from '~/generated-metadata/graphql';
const SettingsGraphQLPlayground = lazy(() =>
import(
@@ -21,7 +21,7 @@ import { isMultiWorkspaceEnabledState } from '@/client-config/states/isMultiWork
import { SnackBarComponentInstanceContext } from '@/ui/feedback/snack-bar-manager/contexts/SnackBarComponentInstanceContext';
import { renderHook } from '@testing-library/react';
import { iconsState } from 'twenty-ui/display';
import { SupportDriver } from '~/generated/graphql';
import { SupportDriver } from '~/generated-metadata/graphql';
const redirectSpy = jest.fn();
@@ -24,6 +24,7 @@ import {
useVerifyEmailAndGetLoginTokenMutation,
useVerifyEmailAndGetWorkspaceAgnosticTokenMutation,
type AuthTokenPair,
type AuthToken,
} from '~/generated-metadata/graphql';
import { tokenPairState } from '@/auth/states/tokenPairState';
@@ -67,7 +68,6 @@ import { useNavigate, useSearchParams } from 'react-router-dom';
import { SOURCE_LOCALE } from 'twenty-shared/translations';
import { isDefined } from 'twenty-shared/utils';
import { iconsState } from 'twenty-ui/display';
import { type AuthToken } from '~/generated/graphql';
import { cookieStorage } from '~/utils/cookie-storage';
import { getWorkspaceUrl } from '~/utils/getWorkspaceUrl';
@@ -27,7 +27,7 @@ import {
IconChevronRight,
IconPlus,
} from 'twenty-ui/display';
import { type AvailableWorkspace } from '~/generated/graphql';
import { type AvailableWorkspace } from '~/generated-metadata/graphql';
import { getWorkspaceUrl } from '~/utils/getWorkspaceUrl';
const StyledContentContainer = styled(motion.div)`
@@ -2,7 +2,10 @@ import { useAuth } from '@/auth/hooks/useAuth';
import { useSignInWithGoogle } from '@/auth/sign-in-up/hooks/useSignInWithGoogle';
import { renderHook } from '@testing-library/react';
import { useParams, useSearchParams } from 'react-router-dom';
import { BillingPlanKey, SubscriptionInterval } from '~/generated/graphql';
import {
BillingPlanKey,
SubscriptionInterval,
} from '~/generated-metadata/graphql';
import { getJestMetadataAndApolloMocksWrapper } from '~/testing/jest/getJestMetadataAndApolloMocksWrapper';
jest.mock('react-router-dom', () => ({
@@ -3,8 +3,10 @@ import { useParams, useSearchParams } from 'react-router-dom';
import { useAuth } from '@/auth/hooks/useAuth';
import { type BillingCheckoutSession } from '@/auth/types/billingCheckoutSession.type';
import { type SocialSSOSignInUpActionType } from '@/auth/types/socialSSOSignInUp.type';
import { BillingPlanKey } from '~/generated/graphql';
import { SubscriptionInterval } from '~/generated-metadata/graphql';
import {
BillingPlanKey,
SubscriptionInterval,
} from '~/generated-metadata/graphql';
export const useSignInWithGoogle = () => {
const workspaceInviteHash = useParams().workspaceInviteHash;
@@ -1,5 +1,5 @@
import { createState } from 'twenty-ui/utilities';
import { type AvailableWorkspaces } from '~/generated/graphql';
import { type AvailableWorkspaces } from '~/generated-metadata/graphql';
export const availableWorkspacesState = createState<AvailableWorkspaces>({
key: 'availableWorkspacesState',
@@ -1,5 +1,5 @@
import { createState } from 'twenty-ui/utilities';
import { type User } from '~/generated/graphql';
import { type User } from '~/generated-metadata/graphql';
export type CurrentUser = Pick<
User,
@@ -1,6 +1,6 @@
import { type ObjectPermissions } from 'twenty-shared/types';
import { createState } from 'twenty-ui/utilities';
import { type UserWorkspace } from '~/generated/graphql';
import { type UserWorkspace } from '~/generated-metadata/graphql';
export type CurrentUserWorkspace = Pick<
UserWorkspace,
@@ -3,7 +3,7 @@ import {
type Application,
type Role,
type Workspace,
} from '~/generated/graphql';
} from '~/generated-metadata/graphql';
export type CurrentWorkspace = Pick<
Workspace,
@@ -1,5 +1,5 @@
import { createState } from 'twenty-ui/utilities';
import { type AuthToken } from '~/generated/graphql';
import { type AuthToken } from '~/generated-metadata/graphql';
export const loginTokenState = createState<AuthToken['token'] | null>({
key: 'loginTokenState',
@@ -1,5 +1,5 @@
import { createState } from 'twenty-ui/utilities';
import { type AuthTokenPair } from '~/generated/graphql';
import { type AuthTokenPair } from '~/generated-metadata/graphql';
import { cookieStorageEffect } from '~/utils/recoil/cookieStorageEffect';
export const tokenPairState = createState<AuthTokenPair | null>({
@@ -1,4 +1,4 @@
import { type PublicWorkspaceDataOutput } from '~/generated/graphql';
import { type PublicWorkspaceDataOutput } from '~/generated-metadata/graphql';
import { createState } from 'twenty-ui/utilities';
export const workspacePublicDataState =
@@ -1,5 +1,7 @@
import { type SubscriptionInterval } from '~/generated-metadata/graphql';
import { type BillingPlanKey } from '~/generated/graphql';
import {
type SubscriptionInterval,
type BillingPlanKey,
} from '~/generated-metadata/graphql';
export type BillingCheckoutSession = {
plan: BillingPlanKey;
@@ -2,7 +2,7 @@ import { AppPath } from 'twenty-shared/types';
import {
type AvailableWorkspace,
type AvailableWorkspaces,
} from '~/generated/graphql';
} from '~/generated-metadata/graphql';
import {
countAvailableWorkspaces,
getAvailableWorkspacePathAndSearchParams,
@@ -4,7 +4,7 @@ import { isDefined } from 'twenty-shared/utils';
import {
type AvailableWorkspace,
type AvailableWorkspaces,
} from '~/generated/graphql';
} from '~/generated-metadata/graphql';
export const countAvailableWorkspaces = ({
availableWorkspacesForSignIn,
@@ -15,7 +15,7 @@ import { formatToShortNumber } from 'twenty-shared/utils';
import { H2Title } from 'twenty-ui/display';
import { ProgressBar } from 'twenty-ui/feedback';
import { Section } from 'twenty-ui/layout';
import { SubscriptionStatus } from '~/generated/graphql';
import { SubscriptionStatus } from '~/generated-metadata/graphql';
const StyledLineSeparator = styled.div`
width: 100%;
@@ -55,8 +55,8 @@ import {
useCancelSwitchMeteredPriceMutation,
useSwitchBillingPlanMutation,
useSwitchSubscriptionIntervalMutation,
SubscriptionStatus,
} from '~/generated-metadata/graphql';
import { SubscriptionStatus } from '~/generated/graphql';
import { beautifyExactDate } from '~/utils/date-utils';
const SWITCH_BILLING_INTERVAL_TO_MONTHLY_MODAL_ID =
@@ -18,8 +18,10 @@ import { useRecoilState } from 'recoil';
import { findOrThrow, isDefined } from 'twenty-shared/utils';
import { H2Title } from 'twenty-ui/display';
import { Button } from 'twenty-ui/input';
import { useSetMeteredSubscriptionPriceMutation } from '~/generated-metadata/graphql';
import { SubscriptionInterval } from '~/generated/graphql';
import {
useSetMeteredSubscriptionPriceMutation,
SubscriptionInterval,
} from '~/generated-metadata/graphql';
const StyledRow = styled.div`
align-items: flex-end;
@@ -2,7 +2,7 @@ import { usePlans } from '@/billing/hooks/usePlans';
import {
type BillingPriceLicensed,
type BillingPriceMetered,
} from '~/generated/graphql';
} from '~/generated-metadata/graphql';
export const useAllBillingPrices = () => {
const { listPlans } = usePlans();
@@ -1,5 +1,7 @@
import { type SubscriptionInterval } from '~/generated-metadata/graphql';
import { type BillingPlanKey } from '~/generated/graphql';
import {
type SubscriptionInterval,
type BillingPlanKey,
} from '~/generated-metadata/graphql';
import { findOrThrow } from 'twenty-shared/utils';
import { useBaseProductByPlanKey } from '@/billing/hooks/useBaseProductByPlanKey';
@@ -1,4 +1,7 @@
import { BillingProductKey, type BillingPlanKey } from '~/generated/graphql';
import {
BillingProductKey,
type BillingPlanKey,
} from '~/generated-metadata/graphql';
import { findOrThrow } from 'twenty-shared/utils';
import { usePlanByPlanKey } from '@/billing/hooks/usePlanByPlanKey';
@@ -1,5 +1,7 @@
import { SubscriptionInterval } from '~/generated-metadata/graphql';
import { BillingPlanKey } from '~/generated/graphql';
import {
SubscriptionInterval,
BillingPlanKey,
} from '~/generated-metadata/graphql';
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
import { useRecoilValue } from 'recoil';
import { assertIsDefinedOrThrow } from 'twenty-shared/utils';
@@ -1,10 +1,12 @@
import { type SubscriptionInterval } from '~/generated-metadata/graphql';
import { BillingProductKey } from '~/generated/graphql';
import { assertIsDefinedOrThrow, findOrThrow } from 'twenty-shared/utils';
import type { MeteredBillingPrice } from '@/billing/types/billing-price-tiers.type';
import { useCurrentPlan } from '@/billing/hooks/useCurrentPlan';
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
import { useCurrentPlan } from '@/billing/hooks/useCurrentPlan';
import type { MeteredBillingPrice } from '@/billing/types/billing-price-tiers.type';
import { useRecoilValue } from 'recoil';
import { assertIsDefinedOrThrow, findOrThrow } from 'twenty-shared/utils';
import {
BillingProductKey,
type SubscriptionInterval,
} from '~/generated-metadata/graphql';
export const useCurrentMetered = () => {
const { currentPlan } = useCurrentPlan();
@@ -1,4 +1,4 @@
import { BillingPlanKey } from '~/generated/graphql';
import { BillingPlanKey } from '~/generated-metadata/graphql';
import { assertIsDefinedOrThrow, findOrThrow } from 'twenty-shared/utils';
import { usePlans } from './usePlans';
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
@@ -1,4 +1,7 @@
import { BillingPlanKey, SubscriptionInterval } from '~/generated/graphql';
import {
BillingPlanKey,
SubscriptionInterval,
} from '~/generated-metadata/graphql';
import { useBaseLicensedPriceByPlanKeyAndInterval } from '@/billing/hooks/useBaseLicensedPriceByPlanKeyAndInterval';
export const useFormatPrices = () => {
@@ -1,4 +1,4 @@
import { type BillingPlanKey } from '~/generated/graphql';
import { type BillingPlanKey } from '~/generated-metadata/graphql';
import { findOrThrow } from 'twenty-shared/utils';
import { usePlans } from './usePlans';
@@ -3,7 +3,7 @@ import {
type BillingPriceLicensed,
type BillingPriceMetered,
BillingUsageType,
} from '~/generated/graphql';
} from '~/generated-metadata/graphql';
import { useAllBillingPrices } from './useAllBillingPrices';
export const usePriceAndBillingUsageByPriceId = () => {
@@ -2,9 +2,9 @@ import { useNextBillingPhase } from '@/billing/hooks/useNextBillingPhase';
import { usePriceAndBillingUsageByPriceId } from '@/billing/hooks/usePriceAndBillingUsageByPriceId';
import { type MeteredBillingPrice } from '@/billing/types/billing-price-tiers.type';
import {
type BillingPriceLicensed,
BillingUsageType,
} from '~/generated/graphql';
type BillingPriceLicensed,
} from '~/generated-metadata/graphql';
export const useSplitPhaseItemsInPrices = () => {
const { nextBillingPhase } = useNextBillingPhase();
@@ -1,4 +1,4 @@
import type { BillingPriceMetered } from '~/generated/graphql';
import type { BillingPriceMetered } from '~/generated-metadata/graphql';
export type BillingPriceTiers = [
{
@@ -9,7 +9,7 @@ import { isCaptchaRequiredForPath } from '@/captcha/utils/isCaptchaRequiredForPa
import { useCaptcha } from '@/client-config/hooks/useCaptcha';
import { captchaState } from '@/client-config/states/captchaState';
import { assertIsDefinedOrThrow } from 'twenty-shared/utils';
import { CaptchaDriverType } from '~/generated/graphql';
import { CaptchaDriverType } from '~/generated-metadata/graphql';
export const CaptchaProviderScriptLoaderEffect = () => {
const captcha = useRecoilValue(captchaState);
@@ -1,4 +1,4 @@
import { CaptchaDriverType } from '~/generated/graphql';
import { CaptchaDriverType } from '~/generated-metadata/graphql';
import { getCaptchaUrlByProvider } from '@/captcha/utils/getCaptchaUrlByProvider';
@@ -1,4 +1,4 @@
import { type ApiConfig } from '~/generated/graphql';
import { type ApiConfig } from '~/generated-metadata/graphql';
import { createState } from 'twenty-ui/utilities';
export const apiConfigState = createState<ApiConfig | null>({
@@ -1,4 +1,4 @@
import { type AuthProviders } from '~/generated/graphql';
import { type AuthProviders } from '~/generated-metadata/graphql';
import { createState } from 'twenty-ui/utilities';
export const authProvidersState = createState<AuthProviders>({
@@ -1,4 +1,4 @@
import { type Billing } from '~/generated/graphql';
import { type Billing } from '~/generated-metadata/graphql';
import { createState } from 'twenty-ui/utilities';
export const billingState = createState<Billing | null>({
@@ -1,4 +1,4 @@
import { type Captcha } from '~/generated/graphql';
import { type Captcha } from '~/generated-metadata/graphql';
import { createState } from 'twenty-ui/utilities';
export const captchaState = createState<Captcha | null>({
@@ -1,5 +1,5 @@
import { atom } from 'recoil';
import { type PublicFeatureFlag } from '~/generated/graphql';
import { type PublicFeatureFlag } from '~/generated-metadata/graphql';
export const labPublicFeatureFlagsState = atom<PublicFeatureFlag[]>({
key: 'labPublicFeatureFlagsState',
@@ -1,4 +1,4 @@
import { type Sentry } from '~/generated/graphql';
import { type Sentry } from '~/generated-metadata/graphql';
import { createState } from 'twenty-ui/utilities';
export const sentryConfigState = createState<Sentry | null>({
@@ -1,5 +1,5 @@
import { createState } from 'twenty-ui/utilities';
import { type Support, SupportDriver } from '~/generated/graphql';
import { type Support, SupportDriver } from '~/generated-metadata/graphql';
export const supportChatState = createState<Support>({
key: 'supportChatState',
@@ -16,9 +16,9 @@ import { COMMAND_MENU_DEFAULT_ICON } from '@/workflow/workflow-trigger/constants
import {
type CommandMenuItemFieldsFragment,
CommandMenuItemAvailabilityType,
FeatureFlagKey,
useFindManyCommandMenuItemsQuery,
} from '~/generated-metadata/graphql';
import { FeatureFlagKey } from '~/generated/graphql';
type CommandMenuItemWithFrontComponent = CommandMenuItemFieldsFragment & {
frontComponentId: string;
@@ -8,7 +8,7 @@ import { useRecoilValue } from 'recoil';
import { IconEdit, IconSparkles } from 'twenty-ui/display';
import { IconButton } from 'twenty-ui/input';
import { useIsMobile } from 'twenty-ui/utilities';
import { FeatureFlagKey } from '~/generated/graphql';
import { FeatureFlagKey } from '~/generated-metadata/graphql';
import { useCreateNewAIChatThread } from '@/ai/hooks/useCreateNewAIChatThread';
@@ -17,7 +17,7 @@ import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
import { isNonEmptyString } from '@sniptt/guards';
import { useRecoilValue } from 'recoil';
import { Key } from 'ts-key-enum';
import { FeatureFlagKey } from '~/generated/graphql';
import { FeatureFlagKey } from '~/generated-metadata/graphql';
export const useCommandMenuHotKeys = () => {
const { toggleCommandMenu } = useCommandMenu();
@@ -8,7 +8,7 @@ import { useFindOneRecord } from '@/object-record/hooks/useFindOneRecord';
import { useUpsertRecordsInStore } from '@/object-record/record-store/hooks/useUpsertRecordsInStore';
import { LayoutRenderingProvider } from '@/ui/layout/contexts/LayoutRenderingContext';
import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';
import { PageLayoutType } from '~/generated/graphql';
import { PageLayoutType } from '~/generated-metadata/graphql';
export const CommandMenuCalendarEventPage = () => {
const { upsertRecordsInStore } = useUpsertRecordsInStore();
@@ -1,7 +1,7 @@
import { getChartLimitMessage } from '@/command-menu/pages/page-layout/utils/getChartLimitMessage';
import { t } from '@lingui/core/macro';
import { SidePanelInformationBanner } from 'twenty-ui/display';
import { type WidgetConfigurationType } from '~/generated/graphql';
import { type WidgetConfigurationType } from '~/generated-metadata/graphql';
type ChartLimitInfoBannerProps = {
widgetConfigurationType: WidgetConfigurationType;
@@ -8,7 +8,7 @@ import { t } from '@lingui/core/macro';
import { isNonEmptyString, isString } from '@sniptt/guards';
import { useState } from 'react';
import { isDefined, isValidUrl } from 'twenty-shared/utils';
import { WidgetConfigurationType } from '~/generated/graphql';
import { WidgetConfigurationType } from '~/generated-metadata/graphql';
const StyledOuterContainer = styled.div`
display: flex;
@@ -33,7 +33,7 @@ import {
FeatureFlagKey,
type FrontComponent,
WidgetType,
} from '~/generated/graphql';
} from '~/generated-metadata/graphql';
export const CommandMenuPageLayoutWidgetTypeSelect = () => {
const { pageLayoutId } = usePageLayoutIdFromContextStoreTargetedRecord();
@@ -12,7 +12,7 @@ import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';
import { MenuItemSelect } from 'twenty-ui/navigation';
import { AxisNameDisplay } from '~/generated/graphql';
import { AxisNameDisplay } from '~/generated-metadata/graphql';
export const ChartAxisNameSelectionDropdownContent = () => {
const { pageLayoutId } = usePageLayoutIdFromContextStoreTargetedRecord();
@@ -91,17 +91,17 @@ export const ChartDataSourceDropdownContent = () => {
updateCurrentWidgetConfig({
objectMetadataId: newObjectMetadataItemId,
configToUpdate: {
aggregateFieldMetadataId: null,
primaryAxisGroupByFieldMetadataId: null,
primaryAxisGroupBySubFieldName: null,
secondaryAxisGroupByFieldMetadataId: null,
secondaryAxisGroupBySubFieldName: null,
primaryAxisOrderBy: null,
secondaryAxisOrderBy: null,
groupByFieldMetadataId: null,
groupBySubFieldName: null,
aggregateFieldMetadataId: undefined,
primaryAxisGroupByFieldMetadataId: undefined,
primaryAxisGroupBySubFieldName: undefined,
secondaryAxisGroupByFieldMetadataId: undefined,
secondaryAxisGroupBySubFieldName: undefined,
primaryAxisOrderBy: undefined,
secondaryAxisOrderBy: undefined,
groupByFieldMetadataId: undefined,
groupBySubFieldName: undefined,
filter: {},
ratioAggregateConfig: null,
ratioAggregateConfig: undefined,
},
});
@@ -17,7 +17,7 @@ import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/ho
import { ObjectRecordGroupByDateGranularity } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { MenuItemSelect } from 'twenty-ui/navigation';
import { type WidgetConfiguration } from '~/generated/graphql';
import { type WidgetConfiguration } from '~/generated-metadata/graphql';
type ChartDateGranularitySelectionDropdownContentProps = {
axis?: 'primary' | 'secondary';
@@ -24,7 +24,7 @@ import { useMemo, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { useIcons } from 'twenty-ui/display';
import { MenuItemSelect } from 'twenty-ui/navigation';
import { RelationType } from '~/generated/graphql';
import { RelationType } from '~/generated-metadata/graphql';
import { filterBySearchQuery } from '~/utils/filterBySearchQuery';
type ChartGroupByFieldSelectionDropdownContentBaseProps<
@@ -18,7 +18,7 @@ import { isDefined } from 'twenty-shared/utils';
import { Tag } from 'twenty-ui/components';
import { IconChevronLeft } from 'twenty-ui/display';
import { MenuItemDraggable } from 'twenty-ui/navigation';
import { type WidgetConfiguration } from '~/generated/graphql';
import { type WidgetConfiguration } from '~/generated-metadata/graphql';
import { moveArrayItem } from '~/utils/array/moveArrayItem';
type ChartManualSortSubMenuContentProps = {
@@ -10,7 +10,7 @@ import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/com
import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';
import { IconCheck, IconX } from 'twenty-ui/display';
import { MenuItemSelect } from 'twenty-ui/navigation';
import { AggregateOperations } from '~/generated/graphql';
import { AggregateOperations } from '~/generated-metadata/graphql';
export const ChartRatioOptionBooleanSelectableListItem = ({
optionValue,
@@ -10,7 +10,7 @@ import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/com
import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';
import { MenuItemSelectTag } from 'twenty-ui/navigation';
import { type ThemeColor } from 'twenty-ui/theme';
import { AggregateOperations } from '~/generated/graphql';
import { AggregateOperations } from '~/generated-metadata/graphql';
export const ChartRatioOptionSelectSelectableListItem = ({
optionValue,
@@ -22,9 +22,9 @@ import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/ho
import { isDefined } from 'twenty-shared/utils';
import { MenuItemSelect } from 'twenty-ui/navigation';
import {
GraphOrderBy,
type GraphOrderBy as GraphOrderByType,
} from '~/generated/graphql';
type GraphOrderBy,
GraphOrderBy as GraphOrderByEnum,
} from '~/generated-metadata/graphql';
export const ChartSortByGroupByFieldDropdownContent = () => {
const [isSubMenuOpen, setIsSubMenuOpen] = useState(false);
@@ -74,12 +74,12 @@ export const ChartSortByGroupByFieldDropdownContent = () => {
return null;
}
const handleSelectSortOption = (orderBy: GraphOrderByType) => {
const handleSelectSortOption = (orderBy: GraphOrderBy) => {
const configToUpdate: Record<string, unknown> = {
secondaryAxisOrderBy: orderBy,
};
if (orderBy === GraphOrderBy.MANUAL) {
if (orderBy === GraphOrderByEnum.MANUAL) {
const existingManualSortOrder =
configuration.secondaryAxisManualSortOrder;
@@ -94,7 +94,7 @@ export const ChartSortByGroupByFieldDropdownContent = () => {
return;
}
if (configuration.secondaryAxisOrderBy === GraphOrderBy.MANUAL) {
if (configuration.secondaryAxisOrderBy === GraphOrderByEnum.MANUAL) {
configToUpdate.secondaryAxisManualSortOrder = null;
}
@@ -125,7 +125,7 @@ export const ChartSortByGroupByFieldDropdownContent = () => {
selectableItemIdArray={availableOptions.map((option) => option.value)}
>
{availableOptions.map((sortOption) => {
const isManualOption = sortOption.value === GraphOrderBy.MANUAL;
const isManualOption = sortOption.value === GraphOrderByEnum.MANUAL;
return (
<SelectableListItem
@@ -138,8 +138,7 @@ export const ChartSortByGroupByFieldDropdownContent = () => {
<MenuItemSelect
text={getGroupBySortOptionLabel({
graphOrderBy: sortOption.value,
groupByFieldMetadataId:
configuration.secondaryAxisGroupByFieldMetadataId,
groupByFieldMetadataId: secondaryAxisField.id,
})}
selected={
configuration.secondaryAxisOrderBy === sortOption.value
@@ -26,7 +26,7 @@ import {
type BarChartConfiguration,
GraphOrderBy,
type LineChartConfiguration,
} from '~/generated/graphql';
} from '~/generated-metadata/graphql';
export const ChartSortBySelectionDropdownContent = () => {
const [isSubMenuOpen, setIsSubMenuOpen] = useState(false);
@@ -3,7 +3,7 @@ import {
IconSortAscending,
IconSortDescending,
} from 'twenty-ui/display';
import { GraphOrderBy } from '~/generated/graphql';
import { GraphOrderBy } from '~/generated-metadata/graphql';
export const AGGREGATE_SORT_BY_OPTIONS = [
{
@@ -1,4 +1,4 @@
import { WidgetConfigurationType } from '~/generated/graphql';
import { WidgetConfigurationType } from '~/generated-metadata/graphql';
export const GRAPH_CONFIGURATION_TYPE_TO_CONFIG_TYPENAME: Partial<
Record<WidgetConfigurationType, string>
@@ -16,7 +16,7 @@ import {
IconGauge,
IconSum,
} from 'twenty-ui/display';
import { BarChartLayout } from '~/generated/graphql';
import { BarChartLayout } from '~/generated-metadata/graphql';
export const GRAPH_TYPE_INFORMATION: Record<
GraphType,
@@ -6,7 +6,7 @@ import {
IconTrendingDown,
IconTrendingUp,
} from 'twenty-ui/display';
import { GraphOrderBy } from '~/generated/graphql';
import { GraphOrderBy } from '~/generated-metadata/graphql';
type XSortByOption = {
value: GraphOrderBy;
@@ -61,8 +61,10 @@ export const useChartSettingsValues = ({
let groupByOrderBy: GraphOrderBy | undefined | null;
if (isBarOrLineChart) {
groupByFieldXId = configuration.primaryAxisGroupByFieldMetadataId;
groupByFieldYId = configuration.secondaryAxisGroupByFieldMetadataId;
groupByFieldXId =
configuration.primaryAxisGroupByFieldMetadataId ?? undefined;
groupByFieldYId =
configuration.secondaryAxisGroupByFieldMetadataId ?? undefined;
groupBySubFieldNameX = configuration.primaryAxisGroupBySubFieldName as
| CompositeFieldSubFieldName
| undefined;
@@ -5,7 +5,7 @@ import { t } from '@lingui/core/macro';
import { useRecoilValue } from 'recoil';
import { type CompositeFieldSubFieldName } from 'twenty-shared/types';
import { assertUnreachable } from 'twenty-shared/utils';
import { GraphOrderBy } from '~/generated/graphql';
import { GraphOrderBy } from '~/generated-metadata/graphql';
export const useGraphGroupBySortOptionLabels = ({
objectMetadataId,
@@ -7,7 +7,7 @@ import { t } from '@lingui/core/macro';
import { useRecoilValue } from 'recoil';
import { type CompositeFieldSubFieldName } from 'twenty-shared/types';
import { assertUnreachable, isDefined } from 'twenty-shared/utils';
import { GraphOrderBy } from '~/generated/graphql';
import { GraphOrderBy } from '~/generated-metadata/graphql';
export const useGraphXSortOptionLabels = ({
objectMetadataId,
@@ -1,7 +1,7 @@
import { type ChartConfiguration } from '@/command-menu/pages/page-layout/types/ChartConfiguration';
import { CHART_CONFIGURATION_SETTING_IDS } from '@/command-menu/pages/page-layout/types/ChartConfigurationSettingIds';
import { getConfigKeyFromSettingId } from '@/command-menu/pages/page-layout/utils/getConfigKeyFromSettingId';
import { BarChartGroupMode } from '~/generated/graphql';
import { BarChartGroupMode } from '~/generated-metadata/graphql';
import { useChartSettingsValues } from './useChartSettingsValues';
import { useUpdateCurrentWidgetConfig } from './useUpdateCurrentWidgetConfig';
@@ -18,7 +18,7 @@ import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTab
import { useRecoilComponentCallbackState } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackState';
import { useRecoilCallback } from 'recoil';
import { isDefined } from 'twenty-shared/utils';
import { BarChartLayout } from '~/generated/graphql';
import { BarChartLayout } from '~/generated-metadata/graphql';
export const useGetConfigToUpdateAfterGraphTypeChange = ({
pageLayoutId,
@@ -1,7 +1,7 @@
import {
type GraphOrderBy,
type ObjectRecordGroupByDateGranularity,
} from '~/generated/graphql';
} from '~/generated-metadata/graphql';
export type BarLineChartConvertibleFields = {
primaryAxisGroupByFieldMetadataId?: string;
@@ -1,7 +1,7 @@
import { type ChartWidgetConfiguration } from '@/command-menu/pages/page-layout/types/ChartWidgetConfiguration';
import { type PageLayoutWidget } from '@/page-layout/types/PageLayoutWidget';
import { type ModifiedProperties } from 'twenty-shared/types';
import { type WidgetType } from '~/generated/graphql';
import { type WidgetType } from '~/generated-metadata/graphql';
export type ChartWidget = ModifiedProperties<
PageLayoutWidget,
@@ -1,7 +1,7 @@
import {
type GraphOrderBy,
type ObjectRecordGroupByDateGranularity,
} from '~/generated/graphql';
} from '~/generated-metadata/graphql';
export type PieChartConvertibleFields = {
groupByFieldMetadataId?: string;
@@ -1,7 +1,7 @@
import {
type AggregateChartConfiguration,
type WidgetConfigurationType,
} from '~/generated/graphql';
} from '~/generated-metadata/graphql';
export type TypedAggregateChartConfiguration = AggregateChartConfiguration & {
configurationType: WidgetConfigurationType.AGGREGATE_CHART;

Some files were not shown because too many files have changed in this diff Show More