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