593b064448
Created: - Services - Resolvers - Controllers - Tests for services - Integration tests for GraphQL and Rest Updated the Rest API playground Added new feature flag `IS_CORE_VIEW_ENABLED` Updated `viewFilter` `operand` and `view` `type` to be enums rather than strings and generated migration file. Closes https://github.com/twentyhq/core-team-issues/issues/1259 --------- Co-authored-by: Félix Malfait <felix.malfait@gmail.com> Co-authored-by: Charles Bochet <charles@twenty.com>
26 lines
613 B
TypeScript
26 lines
613 B
TypeScript
import gql from 'graphql-tag';
|
|
import { VIEW_GQL_FIELDS } from 'test/integration/constants/view-gql-fields.constants';
|
|
|
|
import { View } from 'src/engine/core-modules/view/entities/view.entity';
|
|
|
|
type CreateViewOperationFactoryParams = {
|
|
gqlFields?: string;
|
|
data?: Partial<View>;
|
|
};
|
|
|
|
export const createViewOperationFactory = ({
|
|
gqlFields = VIEW_GQL_FIELDS,
|
|
data = {},
|
|
}: CreateViewOperationFactoryParams = {}) => ({
|
|
query: gql`
|
|
mutation CreateCoreView($input: CreateViewInput!) {
|
|
createCoreView(input: $input) {
|
|
${gqlFields}
|
|
}
|
|
}
|
|
`,
|
|
variables: {
|
|
input: data,
|
|
},
|
|
});
|