59fbe35a8c
# Introduction Preparing view-filter and view-group introduction in v2 core engine Moving view from `core-modules` to `metadata-modules` ## What happened ### Created dedicated modules for each view entity: - ViewFieldModule - ViewFilterModule - ViewFilterGroupModule - ViewGroupModule - ViewSortModule ### Each module is now completely independent with its own: - Controller - Resolver - Service - Entity ### Created dedicated abstraction metadata module folder for: - flat-view-field - flat-view ### Dependencies - Eleminated circular dep on ViewModule to all others ones - Granular import not importing the whole viewModule anymore everywhere close https://github.com/twentyhq/core-team-issues/issues/1703
26 lines
634 B
TypeScript
26 lines
634 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/metadata-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,
|
|
},
|
|
});
|