prisma-nestjs-graphql icon indicating copy to clipboard operation
prisma-nestjs-graphql copied to clipboard

Required `id` field in `UpdateInput`?

Open iquabius opened this issue 3 years ago • 1 comments
trafficstars

Is it possible to make the id field required for all UpdateInput classes?

@InputType()
export class UserUpdateInput {
-    @Field(() => String, { nullable: true })
-    id?: string
+    @Field(() => String, { nullable: false })
+    id!: string

    @Field(() => String, {nullable:true})
    name?: string;

    @Field(() => String, {nullable:true})
    email?: string;
}

iquabius avatar Apr 18 '22 16:04 iquabius

By doing some configuration - no possible, data for fields is coming from Prisma. All fields are optional in *UpdateInput types.

unlight avatar Apr 18 '22 21:04 unlight