prisma-nestjs-graphql
prisma-nestjs-graphql copied to clipboard
Fields missing in "input" if there is a relation
trafficstars
I am missing fields if there is a relation based on those. E.g.:
model customerTest {
id Int @id @default(autoincrement()) @db.UnsignedInt
/// @Validator.IsInt()
posId Int @db.UnsignedTinyInt
posRelation posSettings @relation(fields: [posId], references: [id])
}
Will result in "customer-test-create.input.ts":
import { Field } from '@nestjs/graphql';
import { InputType } from '@nestjs/graphql';
import { posSettingsCreateNestedOneWithoutCustomerTestInput } from '../../pos-settings/inputs/pos-settings-create-nested-one-without-customer-test.input';
import { Type } from 'class-transformer';
@InputType()
export class customerTestCreateInput {
@Field(() => posSettingsCreateNestedOneWithoutCustomerTestInput, {nullable:false})
@Type(() => posSettingsCreateNestedOneWithoutCustomerTestInput)
posRelation!: posSettingsCreateNestedOneWithoutCustomerTestInput;
}
Which makes it impossible to set the "posId" directly.