Add mutationMaximumRecordAffected to clientConfig (#6039)

We are exposing the server mutationMaximumRecordAffected value via
clientConfig so it can be used by the FE.

This is a first step for https://github.com/twentyhq/twenty/issues/6025

<img width="610" alt="Screenshot 2024-06-26 at 14 58 26"
src="https://github.com/twentyhq/twenty/assets/1834158/9d192976-fd22-45d2-bdaa-a8ff6bb90ca2">
This commit is contained in:
Weiko
2024-06-26 15:21:13 +02:00
committed by GitHub
parent cf67ed09d0
commit 6599bc136e
4 changed files with 27 additions and 1 deletions

View File

@ -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;
}

View File

@ -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);