Skip to content

The open alternative to Salesforce, designed for AI.

Add mutationMaximumRecordAffected to clientConfig (#6039)

Weiko6599bc136ec5
diff --git a/packages/twenty-front/src/generated/graphql.tsx b/packages/twenty-front/src/generated/graphql.tsx
index 058d13f8067..b9b22f8f66d 100644
--- a/packages/twenty-front/src/generated/graphql.tsx
+++ b/packages/twenty-front/src/generated/graphql.tsx
@@ -30,6 +30,11 @@ export type Analytics = {
success: Scalars['Boolean'];
};
+export type ApiConfig = {
+ __typename?: 'ApiConfig';
+ mutationMaximumRecordAffected: Scalars['Float'];
+};
+
export type ApiKeyToken = {
__typename?: 'ApiKeyToken';
token: Scalars['String'];
@@ -136,6 +141,7 @@ export enum CaptchaDriverType {
export type ClientConfig = {
__typename?: 'ClientConfig';
+ api: ApiConfig;
authProviders: AuthProviders;
billing: Billing;
captcha: Captcha;
@@ -1229,7 +1235,7 @@ export type UpdateBillingSubscriptionMutation = { __typename?: 'Mutation', updat
export type GetClientConfigQueryVariables = Exact<{ [key: string]: never; }>;
-export type GetClientConfigQuery = { __typename?: 'Query', clientConfig: { __typename?: 'ClientConfig', signInPrefilled: boolean, signUpDisabled: boolean, debugMode: boolean, chromeExtensionId?: string | null, authProviders: { __typename?: 'AuthProviders', google: boolean, password: boolean, microsoft: boolean }, billing: { __typename?: 'Billing', isBillingEnabled: boolean, billingUrl?: string | null, billingFreeTrialDurationInDays?: number | null }, telemetry: { __typename?: 'Telemetry', enabled: boolean }, support: { __typename?: 'Support', supportDriver: string, supportFrontChatId?: string | null }, sentry: { __typename?: 'Sentry', dsn?: string | null, environment?: string | null, release?: string | null }, captcha: { __typename?: 'Captcha', provider?: CaptchaDriverType | null, siteKey?: string | null } } };
+export type GetClientConfigQuery = { __typename?: 'Query', clientConfig: { __typename?: 'ClientConfig', signInPrefilled: boolean, signUpDisabled: boolean, debugMode: boolean, chromeExtensionId?: string | null, authProviders: { __typename?: 'AuthProviders', google: boolean, password: boolean, microsoft: boolean }, billing: { __typename?: 'Billing', isBillingEnabled: boolean, billingUrl?: string | null, billingFreeTrialDurationInDays?: number | null }, telemetry: { __typename?: 'Telemetry', enabled: boolean }, support: { __typename?: 'Support', supportDriver: string, supportFrontChatId?: string | null }, sentry: { __typename?: 'Sentry', dsn?: string | null, environment?: string | null, release?: string | null }, captcha: { __typename?: 'Captcha', provider?: CaptchaDriverType | null, siteKey?: string | null }, api: { __typename?: 'ApiConfig', mutationMaximumRecordAffected: number } } };
export type SkipSyncEmailOnboardingStepMutationVariables = Exact<{ [key: string]: never; }>;
@@ -2355,6 +2361,9 @@ export const GetClientConfigDocument = gql`
provider
siteKey
}
+ api {
+ mutationMaximumRecordAffected
+ }
chromeExtensionId
}
}
diff --git a/packages/twenty-front/src/modules/client-config/graphql/queries/getClientConfig.ts b/packages/twenty-front/src/modules/client-config/graphql/queries/getClientConfig.ts
index 6b98067167c..a7893a55895 100644
--- a/packages/twenty-front/src/modules/client-config/graphql/queries/getClientConfig.ts
+++ b/packages/twenty-front/src/modules/client-config/graphql/queries/getClientConfig.ts
@@ -32,6 +32,9 @@ export const GET_CLIENT_CONFIG = gql`
provider
siteKey
}
+ api {
+ mutationMaximumRecordAffected
+ }
chromeExtensionId
}
}
diff --git a/packages/twenty-server/src/engine/core-modules/client-config/client-config.entity.ts b/packages/twenty-server/src/engine/core-modules/client-config/client-config.entity.ts
index 8252db6ba1a..96788bef287 100644
--- a/packages/twenty-server/src/engine/core-modules/client-config/client-config.entity.ts
+++ b/packages/twenty-server/src/engine/core-modules/client-config/client-config.entity.ts
@@ -65,6 +65,12 @@ class Captcha {
siteKey: string | undefined;
}
+@ObjectType()
+class ApiConfig {
+ @Field(() => Number, { nullable: false })
+ mutationMaximumRecordAffected: number;
+}
+
@ObjectType()
export class ClientConfig {
@Field(() => AuthProviders, { nullable: false })
@@ -96,4 +102,7 @@ export class ClientConfig {
@Field(() => String, { nullable: true })
chromeExtensionId: string | undefined;
+
+ @Field(() => ApiConfig)
+ api: ApiConfig;
}
diff --git a/packages/twenty-server/src/engine/core-modules/client-config/client-config.resolver.ts b/packages/twenty-server/src/engine/core-modules/client-config/client-config.resolver.ts
index 4ce91428ca7..2384e725c2b 100644
--- a/packages/twenty-server/src/engine/core-modules/client-config/client-config.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/client-config/client-config.resolver.ts
@@ -46,6 +46,11 @@ export class ClientConfigResolver {
siteKey: this.environmentService.get('CAPTCHA_SITE_KEY'),
},
chromeExtensionId: this.environmentService.get('CHROME_EXTENSION_ID'),
+ api: {
+ mutationMaximumRecordAffected: this.environmentService.get(
+ 'MUTATION_MAXIMUM_RECORD_AFFECTED',
+ ),
+ },
};
return Promise.resolve(clientConfig);