Skip to content

The open alternative to Salesforce, designed for AI.

Fix codegen and missing track mutation (#11928)

Weiko09850c827fa2
diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.ts
index c459d14603e..03f96f97eef 100644
--- a/packages/twenty-front/src/generated-metadata/graphql.ts
+++ b/packages/twenty-front/src/generated-metadata/graphql.ts
@@ -309,6 +309,7 @@ export type ClientConfig = {
defaultSubdomain?: Maybe<Scalars['String']['output']>;
frontDomain: Scalars['String']['output'];
isAttachmentPreviewEnabled: Scalars['Boolean']['output'];
+ isConfigVariablesInDbEnabled: Scalars['Boolean']['output'];
isEmailVerificationRequired: Scalars['Boolean']['output'];
isGoogleCalendarEnabled: Scalars['Boolean']['output'];
isGoogleMessagingEnabled: Scalars['Boolean']['output'];
@@ -326,14 +327,32 @@ export type ComputeStepOutputSchemaInput = {
step: Scalars['JSON']['input'];
};
+export enum ConfigSource {
+ DATABASE = 'DATABASE',
+ DEFAULT = 'DEFAULT',
+ ENVIRONMENT = 'ENVIRONMENT'
+}
+
export type ConfigVariable = {
__typename?: 'ConfigVariable';
description: Scalars['String']['output'];
+ isEnvOnly: Scalars['Boolean']['output'];
isSensitive: Scalars['Boolean']['output'];
name: Scalars['String']['output'];
- value: Scalars['String']['output'];
+ options?: Maybe<Scalars['JSON']['output']>;
+ source: ConfigSource;
+ type: ConfigVariableType;
+ value?: Maybe<Scalars['JSON']['output']>;
};
+export enum ConfigVariableType {
+ ARRAY = 'ARRAY',
+ BOOLEAN = 'BOOLEAN',
+ ENUM = 'ENUM',
+ NUMBER = 'NUMBER',
+ STRING = 'STRING'
+}
+
export enum ConfigVariablesGroup {
AnalyticsConfig = 'AnalyticsConfig',
BillingConfig = 'BillingConfig',
@@ -941,8 +960,10 @@ export type Mutation = {
checkoutSession: BillingSessionOutput;
computeStepOutputSchema: Scalars['JSON']['output'];
createApprovedAccessDomain: ApprovedAccessDomain;
+ createDatabaseConfigVariable: Scalars['Boolean']['output'];
createDraftFromWorkflowVersion: WorkflowVersion;
createOIDCIdentityProvider: SetupSsoOutput;
+ createObjectEvent: Analytics;
createOneAppToken: AppToken;
createOneField: Field;
createOneObject: Object;
@@ -955,6 +976,7 @@ export type Mutation = {
deactivateWorkflowVersion: Scalars['Boolean']['output'];
deleteApprovedAccessDomain: Scalars['Boolean']['output'];
deleteCurrentWorkspace: Workspace;
+ deleteDatabaseConfigVariable: Scalars['Boolean']['output'];
deleteOneField: Field;
deleteOneObject: Object;
deleteOneRelation: RelationMetadata;
@@ -991,9 +1013,9 @@ export type Mutation = {
switchToYearlyInterval: BillingUpdateOutput;
syncRemoteTable: RemoteTable;
syncRemoteTableSchemaChanges: RemoteTable;
- track: Analytics;
trackAnalytics: Analytics;
unsyncRemoteTable: RemoteTable;
+ updateDatabaseConfigVariable: Scalars['Boolean']['output'];
updateLabPublicFeatureFlag: FeatureFlagDto;
updateOneField: Field;
updateOneObject: Object;
@@ -1052,6 +1074,12 @@ export type MutationCreateApprovedAccessDomainArgs = {
};
+export type MutationCreateDatabaseConfigVariableArgs = {
+ key: Scalars['String']['input'];
+ value: Scalars['JSON']['input'];
+};
+
+
export type MutationCreateDraftFromWorkflowVersionArgs = {
input: CreateDraftFromWorkflowVersionInput;
};
@@ -1062,6 +1090,14 @@ export type MutationCreateOidcIdentityProviderArgs = {
};
+export type MutationCreateObjectEventArgs = {
+ event: Scalars['String']['input'];
+ objectMetadataId: Scalars['String']['input'];
+ properties?: InputMaybe<Scalars['JSON']['input']>;
+ recordId: Scalars['String']['input'];
+};
+
+
export type MutationCreateOneAppTokenArgs = {
input: CreateOneAppTokenInput;
};
@@ -1117,6 +1153,11 @@ export type MutationDeleteApprovedAccessDomainArgs = {
};
+export type MutationDeleteDatabaseConfigVariableArgs = {
+ key: Scalars['String']['input'];
+};
+
+
export type MutationDeleteOneFieldArgs = {
input: DeleteOneFieldInput;
};
@@ -1269,12 +1310,6 @@ export type MutationSyncRemoteTableSchemaChangesArgs = {
};
-export type MutationTrackArgs = {
- action: Scalars['String']['input'];
- payload: Scalars['JSON']['input'];
-};
-
-
export type MutationTrackAnalyticsArgs = {
event?: InputMaybe<Scalars['String']['input']>;
name?: InputMaybe<Scalars['String']['input']>;
@@ -1288,6 +1323,12 @@ export type MutationUnsyncRemoteTableArgs = {
};
+export type MutationUpdateDatabaseConfigVariableArgs = {
+ key: Scalars['String']['input'];
+ value: Scalars['JSON']['input'];
+};
+
+
export type MutationUpdateLabPublicFeatureFlagArgs = {
input: UpdateLabPublicFeatureFlagInput;
};
@@ -1619,6 +1660,7 @@ export type Query = {
getApprovedAccessDomains: Array<ApprovedAccessDomain>;
getAvailablePackages: Scalars['JSON']['output'];
getConfigVariablesGrouped: ConfigVariablesOutput;
+ getDatabaseConfigVariable: ConfigVariable;
getIndicatorHealthStatus: AdminPanelHealthServiceData;
getMeteredProductsUsage: Array<BillingMeteredProductUsageOutput>;
getPostgresCredentials?: Maybe<PostgresCredentials>;
@@ -1701,6 +1743,11 @@ export type QueryGetAvailablePackagesArgs = {
};
+export type QueryGetDatabaseConfigVariableArgs = {
+ key: Scalars['String']['input'];
+};
+
+
export type QueryGetIndicatorHealthStatusArgs = {
indicatorId: HealthIndicatorId;
};
@@ -2494,6 +2541,7 @@ export type WorkflowAction = {
__typename?: 'WorkflowAction';
id: Scalars['UUID']['output'];
name: Scalars['String']['output'];
+ nextStepIds?: Maybe<Array<Scalars['UUID']['output']>>;
settings: Scalars['JSON']['output'];
type: Scalars['String']['output'];
valid: Scalars['Boolean']['output'];
diff --git a/packages/twenty-front/src/generated/graphql.tsx b/packages/twenty-front/src/generated/graphql.tsx
index b25e00e9749..2f1c8176f8d 100644
--- a/packages/twenty-front/src/generated/graphql.tsx
+++ b/packages/twenty-front/src/generated/graphql.tsx
@@ -1,5 +1,5 @@
-import * as Apollo from '@apollo/client';
import { gql } from '@apollo/client';
+import * as Apollo from '@apollo/client';
export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
@@ -887,6 +887,7 @@ export type Mutation = {
createDatabaseConfigVariable: Scalars['Boolean'];
createDraftFromWorkflowVersion: WorkflowVersion;
createOIDCIdentityProvider: SetupSsoOutput;
+ createObjectEvent: Analytics;
createOneAppToken: AppToken;
createOneField: Field;
createOneObject: Object;
@@ -930,7 +931,6 @@ export type Mutation = {
skipSyncEmailOnboardingStep: OnboardingStepSuccess;
submitFormStep: Scalars['Boolean'];
switchToYearlyInterval: BillingUpdateOutput;
- track: Analytics;
trackAnalytics: Analytics;
updateDatabaseConfigVariable: Scalars['Boolean'];
updateLabPublicFeatureFlag: FeatureFlagDto;
@@ -1006,6 +1006,14 @@ export type MutationCreateOidcIdentityProviderArgs = {
};
+export type MutationCreateObjectEventArgs = {
+ event: Scalars['String'];
+ objectMetadataId: Scalars['String'];
+ properties?: InputMaybe<Scalars['JSON']>;
+ recordId: Scalars['String'];
+};
+
+
export type MutationCreateOneFieldArgs = {
input: CreateOneFieldMetadataInput;
};
@@ -1178,12 +1186,6 @@ export type MutationSubmitFormStepArgs = {
};
-export type MutationTrackArgs = {
- action: Scalars['String'];
- payload: Scalars['JSON'];
-};
-
-
export type MutationTrackAnalyticsArgs = {
event?: InputMaybe<Scalars['String']>;
name?: InputMaybe<Scalars['String']>;
@@ -2508,14 +2510,6 @@ export type TrackAnalyticsMutationVariables = Exact<{
export type TrackAnalyticsMutation = { __typename?: 'Mutation', trackAnalytics: { __typename?: 'Analytics', success: boolean } };
-export type TrackMutationVariables = Exact<{
- action: Scalars['String'];
- payload: Scalars['JSON'];
-}>;
-
-
-export type TrackMutation = { __typename?: 'Mutation', track: { __typename?: 'Analytics', success: boolean } };
-
export type UploadFileMutationVariables = Exact<{
file: Scalars['Upload'];
fileFolder?: InputMaybe<FileFolder>;
@@ -3511,40 +3505,6 @@ export function useTrackAnalyticsMutation(baseOptions?: Apollo.MutationHookOptio
export type TrackAnalyticsMutationHookResult = ReturnType<typeof useTrackAnalyticsMutation>;
export type TrackAnalyticsMutationResult = Apollo.MutationResult<TrackAnalyticsMutation>;
export type TrackAnalyticsMutationOptions = Apollo.BaseMutationOptions<TrackAnalyticsMutation, TrackAnalyticsMutationVariables>;
-export const TrackDocument = gql`
- mutation Track($action: String!, $payload: JSON!) {
- track(action: $action, payload: $payload) {
- success
- }
-}
- `;
-export type TrackMutationFn = Apollo.MutationFunction<TrackMutation, TrackMutationVariables>;
-
-/**
- * __useTrackMutation__
- *
- * To run a mutation, you first call `useTrackMutation` within a React component and pass it any options that fit your needs.
- * When your component renders, `useTrackMutation` returns a tuple that includes:
- * - A mutate function that you can call at any time to execute the mutation
- * - An object with fields that represent the current status of the mutation's execution
- *
- * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
- *
- * @example
- * const [trackMutation, { data, loading, error }] = useTrackMutation({
- * variables: {
- * action: // value for 'action'
- * payload: // value for 'payload'
- * },
- * });
- */
-export function useTrackMutation(baseOptions?: Apollo.MutationHookOptions<TrackMutation, TrackMutationVariables>) {
- const options = {...defaultOptions, ...baseOptions}
- return Apollo.useMutation<TrackMutation, TrackMutationVariables>(TrackDocument, options);
- }
-export type TrackMutationHookResult = ReturnType<typeof useTrackMutation>;
-export type TrackMutationResult = Apollo.MutationResult<TrackMutation>;
-export type TrackMutationOptions = Apollo.BaseMutationOptions<TrackMutation, TrackMutationVariables>;
export const UploadFileDocument = gql`
mutation uploadFile($file: Upload!, $fileFolder: FileFolder) {
uploadFile(file: $file, fileFolder: $fileFolder)
diff --git a/packages/twenty-front/src/modules/apollo/services/__tests__/apollo.factory.test.ts b/packages/twenty-front/src/modules/apollo/services/__tests__/apollo.factory.test.ts
index 60d49ac5891..c5933ffbdcb 100644
--- a/packages/twenty-front/src/modules/apollo/services/__tests__/apollo.factory.test.ts
+++ b/packages/twenty-front/src/modules/apollo/services/__tests__/apollo.factory.test.ts
@@ -48,8 +48,18 @@ const makeRequest = async () => {
await client.mutate({
mutation: gql`
- mutation Track($action: String!, $payload: JSON!) {
- track(action: $action, payload: $payload) {
+ mutation TrackAnalytics(
+ $type: AnalyticsType!
+ $event: String
+ $name: String
+ $properties: JSON
+ ) {
+ trackAnalytics(
+ type: $type
+ event: $event
+ name: $name
+ properties: $properties
+ ) {
success
}
}