Separate system operations from core objects in GraphQL endpoints (#12977)

Moves system-level operations (auth, billing, admin) to use the
/metadata endpoint instead of /graphql.

This cleans up the endpoint separation so /graphql is purely for core
objects (Company, People, etc.) and /metadata handles all system
operations.

Part of prep work for webhook/API key core migration.
This commit is contained in:
nitin
2025-07-01 21:59:32 +05:30
committed by GitHub
parent 76c517aa29
commit d2ddd6f473
229 changed files with 9425 additions and 8804 deletions

View File

@ -2,7 +2,7 @@ import { useMutation } from '@apollo/client';
import { CREATE_ONE_DATABASE_CONNECTION } from '@/databases/graphql/mutations/createOneDatabaseConnection';
import { GET_MANY_DATABASE_CONNECTIONS } from '@/databases/graphql/queries/findManyDatabaseConnections';
import { useApolloMetadataClient } from '@/object-metadata/hooks/useApolloMetadataClient';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import {
CreateRemoteServerInput,
CreateServerMutation,
@ -11,7 +11,7 @@ import {
import { isDefined } from 'twenty-shared/utils';
export const useCreateOneDatabaseConnection = () => {
const apolloMetadataClient = useApolloMetadataClient();
const apolloMetadataClient = useApolloCoreClient();
const [mutate] = useMutation<
CreateServerMutation,

View File

@ -3,7 +3,7 @@ import { getOperationName } from '@apollo/client/utilities';
import { DELETE_ONE_DATABASE_CONNECTION } from '@/databases/graphql/mutations/deleteOneDatabaseConnection';
import { GET_MANY_DATABASE_CONNECTIONS } from '@/databases/graphql/queries/findManyDatabaseConnections';
import { useApolloMetadataClient } from '@/object-metadata/hooks/useApolloMetadataClient';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import {
DeleteServerMutation,
DeleteServerMutationVariables,
@ -11,7 +11,7 @@ import {
} from '~/generated-metadata/graphql';
export const useDeleteOneDatabaseConnection = () => {
const apolloMetadataClient = useApolloMetadataClient();
const apolloMetadataClient = useApolloCoreClient();
const [mutate] = useMutation<
DeleteServerMutation,

View File

@ -2,7 +2,7 @@ import { useQuery, WatchQueryFetchPolicy } from '@apollo/client';
import { GET_ONE_DATABASE_CONNECTION } from '@/databases/graphql/queries/findOneDatabaseConnection';
import { getForeignDataWrapperType } from '@/databases/utils/getForeignDataWrapperType';
import { useApolloMetadataClient } from '@/object-metadata/hooks/useApolloMetadataClient';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import {
GetOneDatabaseConnectionQuery,
GetOneDatabaseConnectionQueryVariables,
@ -21,7 +21,7 @@ export const useGetDatabaseConnection = ({
skip,
fetchPolicy,
}: UseGetDatabaseConnectionParams) => {
const apolloMetadataClient = useApolloMetadataClient();
const apolloMetadataClient = useApolloCoreClient();
const foreignDataWrapperType = getForeignDataWrapperType(databaseKey);
const fetchPolicyOption = fetchPolicy ? { fetchPolicy: fetchPolicy } : {};

View File

@ -1,7 +1,7 @@
import { useQuery, WatchQueryFetchPolicy } from '@apollo/client';
import { GET_MANY_REMOTE_TABLES } from '@/databases/graphql/queries/findManyRemoteTables';
import { useApolloMetadataClient } from '@/object-metadata/hooks/useApolloMetadataClient';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import {
GetManyRemoteTablesQuery,
GetManyRemoteTablesQueryVariables,
@ -20,7 +20,7 @@ export const useGetDatabaseConnectionTables = ({
shouldFetchPendingSchemaUpdates,
fetchPolicy,
}: UseGetDatabaseConnectionTablesParams) => {
const apolloMetadataClient = useApolloMetadataClient();
const apolloMetadataClient = useApolloCoreClient();
const fetchPolicyOption = fetchPolicy ? { fetchPolicy: fetchPolicy } : {};

View File

@ -2,7 +2,7 @@ import { useQuery } from '@apollo/client';
import { GET_MANY_DATABASE_CONNECTIONS } from '@/databases/graphql/queries/findManyDatabaseConnections';
import { getForeignDataWrapperType } from '@/databases/utils/getForeignDataWrapperType';
import { useApolloMetadataClient } from '@/object-metadata/hooks/useApolloMetadataClient';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import {
GetManyDatabaseConnectionsQuery,
GetManyDatabaseConnectionsQueryVariables,
@ -17,7 +17,7 @@ export const useGetDatabaseConnections = ({
databaseKey,
skip,
}: UseGetDatabaseConnectionsParams) => {
const apolloMetadataClient = useApolloMetadataClient();
const apolloMetadataClient = useApolloCoreClient();
const foreignDataWrapperType = getForeignDataWrapperType(databaseKey);
const { data } = useQuery<

View File

@ -3,7 +3,7 @@ import { useCallback } from 'react';
import { SYNC_REMOTE_TABLE } from '@/databases/graphql/mutations/syncRemoteTable';
import { modifyRemoteTableFromCache } from '@/databases/utils/modifyRemoteTableFromCache';
import { useApolloMetadataClient } from '@/object-metadata/hooks/useApolloMetadataClient';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { useFindManyObjectMetadataItems } from '@/object-metadata/hooks/useFindManyObjectMetadataItems';
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
import { useFindManyRecordsQuery } from '@/object-record/hooks/useFindManyRecordsQuery';
@ -15,7 +15,7 @@ import {
import { isDefined } from 'twenty-shared/utils';
export const useSyncRemoteTable = () => {
const apolloMetadataClient = useApolloMetadataClient();
const apolloMetadataClient = useApolloCoreClient();
const apolloClient = useApolloClient();
const { refetch: refetchObjectMetadataItems } =

View File

@ -3,7 +3,7 @@ import { useCallback } from 'react';
import { SYNC_REMOTE_TABLE_SCHEMA_CHANGES } from '@/databases/graphql/mutations/syncRemoteTableSchemaChanges';
import { modifyRemoteTableFromCache } from '@/databases/utils/modifyRemoteTableFromCache';
import { useApolloMetadataClient } from '@/object-metadata/hooks/useApolloMetadataClient';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { useFindManyObjectMetadataItems } from '@/object-metadata/hooks/useFindManyObjectMetadataItems';
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
import { useFindManyRecordsQuery } from '@/object-record/hooks/useFindManyRecordsQuery';
@ -15,7 +15,7 @@ import {
import { isDefined } from 'twenty-shared/utils';
export const useSyncRemoteTableSchemaChanges = () => {
const apolloMetadataClient = useApolloMetadataClient();
const apolloMetadataClient = useApolloCoreClient();
const apolloClient = useApolloClient();
const { refetch: refetchObjectMetadataItems } =

View File

@ -3,7 +3,7 @@ import { useCallback } from 'react';
import { UNSYNC_REMOTE_TABLE } from '@/databases/graphql/mutations/unsyncRemoteTable';
import { modifyRemoteTableFromCache } from '@/databases/utils/modifyRemoteTableFromCache';
import { useApolloMetadataClient } from '@/object-metadata/hooks/useApolloMetadataClient';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { useFindManyObjectMetadataItems } from '@/object-metadata/hooks/useFindManyObjectMetadataItems';
import {
RemoteTableInput,
@ -13,7 +13,7 @@ import {
import { isDefined } from 'twenty-shared/utils';
export const useUnsyncRemoteTable = () => {
const apolloMetadataClient = useApolloMetadataClient();
const apolloMetadataClient = useApolloCoreClient();
const { refetch: refetchObjectMetadataItems } =
useFindManyObjectMetadataItems();

View File

@ -1,7 +1,7 @@
import { useMutation } from '@apollo/client';
import { UPDATE_ONE_DATABASE_CONNECTION } from '@/databases/graphql/mutations/updateOneDatabaseConnection';
import { useApolloMetadataClient } from '@/object-metadata/hooks/useApolloMetadataClient';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import {
UpdateRemoteServerInput,
UpdateServerMutation,
@ -9,7 +9,7 @@ import {
} from '~/generated-metadata/graphql';
export const useUpdateOneDatabaseConnection = () => {
const apolloMetadataClient = useApolloMetadataClient();
const apolloMetadataClient = useApolloCoreClient();
const [mutate] = useMutation<
UpdateServerMutation,