Files
twenty/packages/twenty-server/test/integration/graphql/utils/create-view-group-operation-factory.util.ts
T
Félix Malfait 8b4b9ef8da Change type import rule (#13751)
Forcing "type" to be explicit, works best will rollup on the frontend to
exclude depdendencies
2025-08-08 01:27:05 +02:00

26 lines
676 B
TypeScript

import gql from 'graphql-tag';
import { VIEW_GROUP_GQL_FIELDS } from 'test/integration/constants/view-gql-fields.constants';
import { type ViewGroup } from 'src/engine/core-modules/view/entities/view-group.entity';
type CreateViewGroupOperationFactoryParams = {
gqlFields?: string;
data?: Partial<ViewGroup>;
};
export const createViewGroupOperationFactory = ({
gqlFields = VIEW_GROUP_GQL_FIELDS,
data = {},
}: CreateViewGroupOperationFactoryParams = {}) => ({
query: gql`
mutation CreateCoreViewGroup($input: CreateViewGroupInput!) {
createCoreViewGroup(input: $input) {
${gqlFields}
}
}
`,
variables: {
input: data,
},
});