prisma-nestjs-graphql
prisma-nestjs-graphql copied to clipboard
Support options for scalar list fields
https://www.prisma.io/docs/orm/prisma-client/special-fields-and-types/working-with-scalar-lists-arrays#setting-the-value-of-a-scalar-list
Using a scalar list in postgres leads to generated type requiring a set field, should support direct setting as outlined in linked doc.
Example model with output types
model Task {
...
categories String[]
...
}
@InputType()
export class TaskCreateInput {
...
@Field(() => TaskCreatecategoriesInput, {nullable:true})
categories?: TaskCreatecategoriesInput;
...
}
@InputType()
export class TaskCreatecategoriesInput {
@Field(() => [String], {nullable:false})
set!: Array<string>;
}
This leads to requiring inputs always use the set: [...] form, and prevents being able to set the value directly, or use unset: true.
I did not get. You are referencing to postgres, but documentation says that unset is supported by MongoDB only