Rename mutation maximum affected records (#6042)

As per my last comment on https://github.com/twentyhq/twenty/pull/6039,
we decided to rename this var
This commit is contained in:
Weiko
2024-06-26 18:00:25 +02:00
committed by GitHub
parent 87abc1b31d
commit 1eb9c582f3
10 changed files with 26 additions and 13 deletions

View File

@ -32,7 +32,7 @@ export type Analytics = {
export type ApiConfig = {
__typename?: 'ApiConfig';
mutationMaximumRecordAffected: Scalars['Float'];
mutationMaximumAffectedRecords: Scalars['Float'];
};
export type ApiKeyToken = {
@ -1235,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 }, api: { __typename?: 'ApiConfig', mutationMaximumRecordAffected: number } } };
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', mutationMaximumAffectedRecords: number } } };
export type SkipSyncEmailOnboardingStepMutationVariables = Exact<{ [key: string]: never; }>;
@ -2362,7 +2362,7 @@ export const GetClientConfigDocument = gql`
siteKey
}
api {
mutationMaximumRecordAffected
mutationMaximumAffectedRecords
}
chromeExtensionId
}

View File

@ -1,6 +1,7 @@
import { useEffect } from 'react';
import { useRecoilState, useSetRecoilState } from 'recoil';
import { apiConfigState } from '@/client-config/states/apiConfigState';
import { authProvidersState } from '@/client-config/states/authProvidersState';
import { billingState } from '@/client-config/states/billingState';
import { captchaProviderState } from '@/client-config/states/captchaProviderState';
@ -35,6 +36,8 @@ export const ClientConfigProviderEffect = () => {
const setChromeExtensionId = useSetRecoilState(chromeExtensionIdState);
const setApiConfig = useSetRecoilState(apiConfigState);
const { data, loading } = useGetClientConfigQuery({
skip: isClientConfigLoaded,
});
@ -68,6 +71,7 @@ export const ClientConfigProviderEffect = () => {
});
setChromeExtensionId(data?.clientConfig?.chromeExtensionId);
setApiConfig(data?.clientConfig?.api);
}
}, [
data,
@ -83,6 +87,7 @@ export const ClientConfigProviderEffect = () => {
setIsClientConfigLoaded,
setCaptchaProvider,
setChromeExtensionId,
setApiConfig,
]);
return <></>;

View File

@ -33,7 +33,7 @@ export const GET_CLIENT_CONFIG = gql`
siteKey
}
api {
mutationMaximumRecordAffected
mutationMaximumAffectedRecords
}
chromeExtensionId
}

View File

@ -0,0 +1,8 @@
import { createState } from 'twenty-ui';
import { ApiConfig } from '~/generated/graphql';
export const apiConfigState = createState<ApiConfig | null>({
key: 'apiConfigState',
defaultValue: null,
});