Files
twenty/packages/twenty-server/test/integration/graphql/utils/create-view-operation-factory.util.ts
T
WeikoandGitHub f06786d603 Add missing FK on view tables (#14084)
## Context
View tables were missing some FK, we are also introducing delete cascade
on those tables when needed to leverage pg cascade deletion instead of
having to implement it.
Also renaming those classes with Entity suffix to follow repo
guidelines.
2025-08-26 18:59:20 +02:00

26 lines
630 B
TypeScript

import gql from 'graphql-tag';
import { VIEW_GQL_FIELDS } from 'test/integration/constants/view-gql-fields.constants';
import { type ViewEntity } from 'src/engine/core-modules/view/entities/view.entity';
type CreateViewOperationFactoryParams = {
gqlFields?: string;
data?: Partial<ViewEntity>;
};
export const createViewOperationFactory = ({
gqlFields = VIEW_GQL_FIELDS,
data = {},
}: CreateViewOperationFactoryParams = {}) => ({
query: gql`
mutation CreateCoreView($input: CreateViewInput!) {
createCoreView(input: $input) {
${gqlFields}
}
}
`,
variables: {
input: data,
},
});