feat: add object/field create/update resolvers (#1963)

* feat: add object/field create/update resolvers

* fix tests
This commit is contained in:
Weiko
2023-10-11 12:03:13 +02:00
committed by GitHub
parent 6a3002ddf9
commit f97228bfac
32 changed files with 657 additions and 429 deletions

View File

@ -0,0 +1,51 @@
import { Field, InputType } from '@nestjs/graphql';
import {
IsEnum,
IsNotEmpty,
IsOptional,
IsString,
IsUUID,
} from 'class-validator';
@InputType()
export class CreateFieldInput {
@IsString()
@IsNotEmpty()
@Field()
displayName: string;
// Todo: use a type enum and share with typeorm entity
@IsEnum([
'text',
'phone',
'email',
'number',
'boolean',
'date',
'url',
'money',
])
@IsNotEmpty()
@Field()
type: string;
@IsUUID()
@Field()
objectId: string;
@IsString()
@IsOptional()
@Field({ nullable: true })
description?: string;
@IsString()
@IsOptional()
@Field({ nullable: true })
icon?: string;
@IsString()
@IsOptional()
@Field({ nullable: true })
placeholder?: string;
}