import { Field, HideField, InputType } from '@nestjs/graphql'; import { BeforeCreateOne } from '@ptc-org/nestjs-query-graphql'; import { IsNotEmpty, IsOptional, IsString } from 'class-validator'; import { BeforeCreateOneObject } from 'src/metadata/object-metadata/hooks/before-create-one-object.hook'; @InputType() @BeforeCreateOne(BeforeCreateOneObject) export class CreateObjectInput { @IsString() @IsNotEmpty() @Field() nameSingular: string; @IsString() @IsNotEmpty() @Field() namePlural: string; @IsString() @IsNotEmpty() @Field() labelSingular: string; @IsString() @IsNotEmpty() @Field() labelPlural: string; @IsString() @IsOptional() @Field({ nullable: true }) description?: string; @IsString() @IsOptional() @Field({ nullable: true }) icon?: string; @HideField() dataSourceId: string; @HideField() workspaceId: string; }