Skip to content

Commit

Permalink
cleanup pg_graphql #1 (#7673)
Browse files Browse the repository at this point in the history
## Context
This PR removes workspace-query-runner/builder in preparation for fully
deprecating pg_graphql

next steps: Remove from the setup and make a command to remove comments
on schema/tables related to pg_graphql
  • Loading branch information
Weiko authored Oct 14, 2024
1 parent a64635a commit efba3b1
Show file tree
Hide file tree
Showing 34 changed files with 138 additions and 2,790 deletions.
13 changes: 0 additions & 13 deletions packages/twenty-front/src/generated-metadata/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@ export type Scalars = {
Upload: { input: any; output: any; }
};

export type AisqlQueryResult = {
__typename?: 'AISQLQueryResult';
queryFailedErrorMessage?: Maybe<Scalars['String']['output']>;
sqlQuery: Scalars['String']['output'];
sqlQueryResult?: Maybe<Scalars['String']['output']>;
};

export type ActivateWorkspaceInput = {
displayName?: InputMaybe<Scalars['String']['input']>;
};
Expand Down Expand Up @@ -862,7 +855,6 @@ export type Query = {
findOneRemoteServerById: RemoteServer;
findWorkspaceFromInviteHash: Workspace;
findWorkspaceInvitations: Array<WorkspaceInvitation>;
getAISQLQuery: AisqlQueryResult;
getAvailablePackages: Scalars['JSON']['output'];
getPostgresCredentials?: Maybe<PostgresCredentials>;
getProductPrices: ProductPricesEntity;
Expand Down Expand Up @@ -930,11 +922,6 @@ export type QueryFindWorkspaceFromInviteHashArgs = {
};


export type QueryGetAisqlQueryArgs = {
text: Scalars['String']['input'];
};


export type QueryGetProductPricesArgs = {
product: Scalars['String']['input'];
};
Expand Down
207 changes: 129 additions & 78 deletions packages/twenty-front/src/generated/graphql.tsx
Original file line number Diff line number Diff line change
@@ -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] };
Expand All @@ -21,13 +21,6 @@ export type Scalars = {
Upload: any;
};

export type AisqlQueryResult = {
__typename?: 'AISQLQueryResult';
queryFailedErrorMessage?: Maybe<Scalars['String']>;
sqlQuery: Scalars['String'];
sqlQueryResult?: Maybe<Scalars['String']>;
};

export type ActivateWorkspaceInput = {
displayName?: InputMaybe<Scalars['String']>;
};
Expand Down Expand Up @@ -160,13 +153,7 @@ export type ClientConfig = {
support: Support;
};

export type CreateServerlessFunctionFromFileInput = {
description?: InputMaybe<Scalars['String']>;
name: Scalars['String'];
};

export type CreateServerlessFunctionInput = {
code: Scalars['String'];
description?: InputMaybe<Scalars['String']>;
name: Scalars['String'];
};
Expand Down Expand Up @@ -302,6 +289,36 @@ export type GetServerlessFunctionSourceCodeInput = {
version?: Scalars['String'];
};

export type IndexConnection = {
__typename?: 'IndexConnection';
/** Array of edges. */
edges: Array<IndexEdge>;
/** Paging information */
pageInfo: PageInfo;
};

export type IndexIndexFieldMetadatasConnection = {
__typename?: 'IndexIndexFieldMetadatasConnection';
/** Array of edges. */
edges: Array<IndexFieldEdge>;
/** Paging information */
pageInfo: PageInfo;
};

export type IndexObjectMetadataConnection = {
__typename?: 'IndexObjectMetadataConnection';
/** Array of edges. */
edges: Array<ObjectEdge>;
/** Paging information */
pageInfo: PageInfo;
};

/** Type of the index */
export enum IndexType {
Btree = 'BTREE',
Gin = 'GIN'
}

export type InvalidatePassword = {
__typename?: 'InvalidatePassword';
/** Boolean that confirms query was dispatched */
Expand Down Expand Up @@ -344,7 +361,6 @@ export type Mutation = {
createOneAppToken: AppToken;
createOneObject: Object;
createOneServerlessFunction: ServerlessFunction;
createOneServerlessFunctionFromFile: ServerlessFunction;
deactivateWorkflowVersion: Scalars['Boolean'];
deleteCurrentWorkspace: Workspace;
deleteOneObject: Object;
Expand Down Expand Up @@ -426,12 +442,6 @@ export type MutationCreateOneServerlessFunctionArgs = {
};


export type MutationCreateOneServerlessFunctionFromFileArgs = {
file: Scalars['Upload'];
input: CreateServerlessFunctionFromFileInput;
};


export type MutationDeactivateWorkflowVersionArgs = {
workflowVersionId: Scalars['String'];
};
Expand Down Expand Up @@ -520,9 +530,8 @@ export type MutationSignUpArgs = {


export type MutationTrackArgs = {
data: Scalars['JSON'];
sessionId: Scalars['String'];
type: Scalars['String'];
action: Scalars['String'];
payload: Scalars['JSON'];
};


Expand Down Expand Up @@ -589,6 +598,14 @@ export type ObjectFieldsConnection = {
pageInfo: PageInfo;
};

export type ObjectIndexMetadatasConnection = {
__typename?: 'ObjectIndexMetadatasConnection';
/** Array of edges. */
edges: Array<IndexEdge>;
/** Paging information */
pageInfo: PageInfo;
};

/** Onboarding status */
export enum OnboardingStatus {
Completed = 'COMPLETED',
Expand Down Expand Up @@ -654,15 +671,16 @@ export type Query = {
currentWorkspace: Workspace;
findWorkspaceFromInviteHash: Workspace;
findWorkspaceInvitations: Array<WorkspaceInvitation>;
getAISQLQuery: AisqlQueryResult;
getAvailablePackages: Scalars['JSON'];
getPostgresCredentials?: Maybe<PostgresCredentials>;
getProductPrices: ProductPricesEntity;
getServerlessFunctionSourceCode?: Maybe<Scalars['String']>;
getServerlessFunctionSourceCode?: Maybe<Scalars['JSON']>;
getTimelineCalendarEventsFromCompanyId: TimelineCalendarEventsWithTotal;
getTimelineCalendarEventsFromPersonId: TimelineCalendarEventsWithTotal;
getTimelineThreadsFromCompanyId: TimelineThreadsWithTotal;
getTimelineThreadsFromPersonId: TimelineThreadsWithTotal;
index: Index;
indexMetadatas: IndexConnection;
object: Object;
objects: ObjectConnection;
serverlessFunction: ServerlessFunction;
Expand Down Expand Up @@ -692,11 +710,6 @@ export type QueryFindWorkspaceFromInviteHashArgs = {
};


export type QueryGetAisqlQueryArgs = {
text: Scalars['String'];
};


export type QueryGetProductPricesArgs = {
product: Scalars['String'];
};
Expand Down Expand Up @@ -831,7 +844,6 @@ export type ServerlessFunction = {
latestVersion?: Maybe<Scalars['String']>;
name: Scalars['String'];
runtime: Scalars['String'];
sourceCodeHash: Scalars['String'];
syncStatus: ServerlessFunctionSyncStatus;
updatedAt: Scalars['DateTime'];
};
Expand Down Expand Up @@ -1028,7 +1040,7 @@ export type UpdateOneObjectInput = {
};

export type UpdateServerlessFunctionInput = {
code: Scalars['String'];
code: Scalars['JSON'];
description?: InputMaybe<Scalars['String']>;
/** Id of the serverless function to execute */
id: Scalars['UUID'];
Expand Down Expand Up @@ -1213,6 +1225,7 @@ export type Field = {
isCustom?: Maybe<Scalars['Boolean']>;
isNullable?: Maybe<Scalars['Boolean']>;
isSystem?: Maybe<Scalars['Boolean']>;
isUnique?: Maybe<Scalars['Boolean']>;
label: Scalars['String'];
name: Scalars['String'];
object?: Maybe<Object>;
Expand Down Expand Up @@ -1241,6 +1254,71 @@ export type FieldFilter = {
or?: InputMaybe<Array<FieldFilter>>;
};

export type Index = {
__typename?: 'index';
createdAt: Scalars['DateTime'];
id: Scalars['UUID'];
indexFieldMetadatas: IndexIndexFieldMetadatasConnection;
indexType: IndexType;
indexWhereClause?: Maybe<Scalars['String']>;
isCustom?: Maybe<Scalars['Boolean']>;
isUnique: Scalars['Boolean'];
name: Scalars['String'];
objectMetadata: IndexObjectMetadataConnection;
updatedAt: Scalars['DateTime'];
};


export type IndexIndexFieldMetadatasArgs = {
filter?: IndexFieldFilter;
paging?: CursorPaging;
};


export type IndexObjectMetadataArgs = {
filter?: ObjectFilter;
paging?: CursorPaging;
};

export type IndexEdge = {
__typename?: 'indexEdge';
/** Cursor for this node. */
cursor: Scalars['ConnectionCursor'];
/** The node containing the index */
node: Index;
};

export type IndexField = {
__typename?: 'indexField';
createdAt: Scalars['DateTime'];
fieldMetadataId: Scalars['UUID'];
id: Scalars['UUID'];
order: Scalars['Float'];
updatedAt: Scalars['DateTime'];
};

export type IndexFieldEdge = {
__typename?: 'indexFieldEdge';
/** Cursor for this node. */
cursor: Scalars['ConnectionCursor'];
/** The node containing the indexField */
node: IndexField;
};

export type IndexFieldFilter = {
and?: InputMaybe<Array<IndexFieldFilter>>;
fieldMetadataId?: InputMaybe<UuidFilterComparison>;
id?: InputMaybe<UuidFilterComparison>;
or?: InputMaybe<Array<IndexFieldFilter>>;
};

export type IndexFilter = {
and?: InputMaybe<Array<IndexFilter>>;
id?: InputMaybe<UuidFilterComparison>;
isCustom?: InputMaybe<BooleanFieldComparison>;
or?: InputMaybe<Array<IndexFilter>>;
};

export type Object = {
__typename?: 'object';
createdAt: Scalars['DateTime'];
Expand All @@ -1250,6 +1328,7 @@ export type Object = {
icon?: Maybe<Scalars['String']>;
id: Scalars['UUID'];
imageIdentifierFieldMetadataId?: Maybe<Scalars['String']>;
indexMetadatas: ObjectIndexMetadatasConnection;
isActive: Scalars['Boolean'];
isCustom: Scalars['Boolean'];
isRemote: Scalars['Boolean'];
Expand All @@ -1268,6 +1347,12 @@ export type ObjectFieldsArgs = {
paging?: CursorPaging;
};


export type ObjectIndexMetadatasArgs = {
filter?: IndexFilter;
paging?: CursorPaging;
};

export type ObjectEdge = {
__typename?: 'objectEdge';
/** Cursor for this node. */
Expand All @@ -1276,6 +1361,16 @@ export type ObjectEdge = {
node: Object;
};

export type ObjectFilter = {
and?: InputMaybe<Array<ObjectFilter>>;
id?: InputMaybe<UuidFilterComparison>;
isActive?: InputMaybe<BooleanFieldComparison>;
isCustom?: InputMaybe<BooleanFieldComparison>;
isRemote?: InputMaybe<BooleanFieldComparison>;
isSystem?: InputMaybe<BooleanFieldComparison>;
or?: InputMaybe<Array<ObjectFilter>>;
};

export type Relation = {
__typename?: 'relation';
createdAt: Scalars['DateTime'];
Expand Down Expand Up @@ -1511,13 +1606,6 @@ export type SkipSyncEmailOnboardingStepMutationVariables = Exact<{ [key: string]

export type SkipSyncEmailOnboardingStepMutation = { __typename?: 'Mutation', skipSyncEmailOnboardingStep: { __typename?: 'OnboardingStepSuccess', success: boolean } };

export type GetAisqlQueryQueryVariables = Exact<{
text: Scalars['String'];
}>;


export type GetAisqlQueryQuery = { __typename?: 'Query', getAISQLQuery: { __typename?: 'AISQLQueryResult', sqlQuery: string, sqlQueryResult?: string | null, queryFailedErrorMessage?: string | null } };

export type UserQueryFragmentFragment = { __typename?: 'User', id: any, firstName: string, lastName: string, email: string, canImpersonate: boolean, supportUserHash?: string | null, onboardingStatus?: OnboardingStatus | null, userVars: any, workspaceMember?: { __typename?: 'WorkspaceMember', id: any, colorScheme: string, avatarUrl?: string | null, locale?: string | null, timeZone?: string | null, dateFormat?: WorkspaceMemberDateFormatEnum | null, timeFormat?: WorkspaceMemberTimeFormatEnum | null, name: { __typename?: 'FullName', firstName: string, lastName: string } } | null, workspaceMembers?: Array<{ __typename?: 'WorkspaceMember', id: any, colorScheme: string, avatarUrl?: string | null, locale?: string | null, timeZone?: string | null, dateFormat?: WorkspaceMemberDateFormatEnum | null, timeFormat?: WorkspaceMemberTimeFormatEnum | null, name: { __typename?: 'FullName', firstName: string, lastName: string } }> | null, defaultWorkspace: { __typename?: 'Workspace', id: any, displayName?: string | null, logo?: string | null, domainName?: string | null, inviteHash?: string | null, allowImpersonation: boolean, activationStatus: WorkspaceActivationStatus, metadataVersion: number, workspaceMembersCount?: number | null, featureFlags?: Array<{ __typename?: 'FeatureFlag', id: any, key: string, value: boolean, workspaceId: string }> | null, currentBillingSubscription?: { __typename?: 'BillingSubscription', id: any, status: SubscriptionStatus, interval?: SubscriptionInterval | null } | null }, workspaces: Array<{ __typename?: 'UserWorkspace', workspace?: { __typename?: 'Workspace', id: any, logo?: string | null, displayName?: string | null, domainName?: string | null } | null }> };

export type DeleteUserAccountMutationVariables = Exact<{ [key: string]: never; }>;
Expand Down Expand Up @@ -1962,7 +2050,7 @@ export type TrackMutationFn = Apollo.MutationFunction<TrackMutation, TrackMutati
* @example
* const [trackMutation, { data, loading, error }] = useTrackMutation({
* variables: {
* action: // value for 'type'
* action: // value for 'action'
* payload: // value for 'payload'
* },
* });
Expand Down Expand Up @@ -2756,43 +2844,6 @@ export function useSkipSyncEmailOnboardingStepMutation(baseOptions?: Apollo.Muta
export type SkipSyncEmailOnboardingStepMutationHookResult = ReturnType<typeof useSkipSyncEmailOnboardingStepMutation>;
export type SkipSyncEmailOnboardingStepMutationResult = Apollo.MutationResult<SkipSyncEmailOnboardingStepMutation>;
export type SkipSyncEmailOnboardingStepMutationOptions = Apollo.BaseMutationOptions<SkipSyncEmailOnboardingStepMutation, SkipSyncEmailOnboardingStepMutationVariables>;
export const GetAisqlQueryDocument = gql`
query GetAISQLQuery($text: String!) {
getAISQLQuery(text: $text) {
sqlQuery
sqlQueryResult
queryFailedErrorMessage
}
}
`;

/**
* __useGetAisqlQueryQuery__
*
* To run a query within a React component, call `useGetAisqlQueryQuery` and pass it any options that fit your needs.
* When your component renders, `useGetAisqlQueryQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useGetAisqlQueryQuery({
* variables: {
* text: // value for 'text'
* },
* });
*/
export function useGetAisqlQueryQuery(baseOptions: Apollo.QueryHookOptions<GetAisqlQueryQuery, GetAisqlQueryQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<GetAisqlQueryQuery, GetAisqlQueryQueryVariables>(GetAisqlQueryDocument, options);
}
export function useGetAisqlQueryLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetAisqlQueryQuery, GetAisqlQueryQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<GetAisqlQueryQuery, GetAisqlQueryQueryVariables>(GetAisqlQueryDocument, options);
}
export type GetAisqlQueryQueryHookResult = ReturnType<typeof useGetAisqlQueryQuery>;
export type GetAisqlQueryLazyQueryHookResult = ReturnType<typeof useGetAisqlQueryLazyQuery>;
export type GetAisqlQueryQueryResult = Apollo.QueryResult<GetAisqlQueryQuery, GetAisqlQueryQueryVariables>;
export const DeleteUserAccountDocument = gql`
mutation DeleteUserAccount {
deleteUser {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { gql } from '@apollo/client';

export const TRACK = gql`
mutation Track($type: String!, $sessionId: String!, $data: JSON!) {
track(type: $type, sessionId: $sessionId, data: $data) {
mutation Track($action: String!, $payload: JSON!) {
track(action: $action, payload: $payload) {
success
}
}
Expand Down
Loading

0 comments on commit efba3b1

Please sign in to comment.