fix: displayName return undefined and drop displayName from user table (#505)

This commit is contained in:
Jérémy M
2023-07-04 20:08:15 +02:00
committed by GitHub
parent d83313cd93
commit 6fc416da76
98 changed files with 128 additions and 222 deletions

View File

@ -45,6 +45,7 @@
"@paljs/plugins": "^5.3.3", "@paljs/plugins": "^5.3.3",
"@prisma/client": "^4.13.0", "@prisma/client": "^4.13.0",
"@types/lodash.camelcase": "^4.3.7", "@types/lodash.camelcase": "^4.3.7",
"@types/lodash.merge": "^4.6.7",
"add": "^2.0.6", "add": "^2.0.6",
"apollo-server-express": "^3.12.0", "apollo-server-express": "^3.12.0",
"axios": "^1.4.0", "axios": "^1.4.0",
@ -60,6 +61,7 @@
"lodash.camelcase": "^4.3.0", "lodash.camelcase": "^4.3.0",
"lodash.isobject": "^3.0.2", "lodash.isobject": "^3.0.2",
"lodash.kebabcase": "^4.1.1", "lodash.kebabcase": "^4.1.1",
"lodash.merge": "^4.6.2",
"ms": "^2.1.3", "ms": "^2.1.3",
"passport": "^0.6.0", "passport": "^0.6.0",
"passport-google-oauth20": "^2.0.0", "passport-google-oauth20": "^2.0.0",

View File

@ -9,8 +9,8 @@ export class CreateManyCommentThreadTargetArgs {
@Field(() => [CommentThreadTargetCreateManyInput], {nullable:false}) @Field(() => [CommentThreadTargetCreateManyInput], {nullable:false})
@Type(() => CommentThreadTargetCreateManyInput) @Type(() => CommentThreadTargetCreateManyInput)
@ValidateNested({each: true})
@Type(() => CommentThreadTargetCreateManyInput) @Type(() => CommentThreadTargetCreateManyInput)
@ValidateNested({each: true})
data!: Array<CommentThreadTargetCreateManyInput>; data!: Array<CommentThreadTargetCreateManyInput>;
@Field(() => Boolean, {nullable:true}) @Field(() => Boolean, {nullable:true})

View File

@ -9,7 +9,7 @@ export class CreateOneCommentThreadTargetArgs {
@Field(() => CommentThreadTargetCreateInput, {nullable:false}) @Field(() => CommentThreadTargetCreateInput, {nullable:false})
@Type(() => CommentThreadTargetCreateInput) @Type(() => CommentThreadTargetCreateInput)
@ValidateNested({each: true})
@Type(() => CommentThreadTargetCreateInput) @Type(() => CommentThreadTargetCreateInput)
@ValidateNested({each: true})
data!: CommentThreadTargetCreateInput; data!: CommentThreadTargetCreateInput;
} }

View File

@ -10,8 +10,8 @@ export class UpdateManyCommentThreadTargetArgs {
@Field(() => CommentThreadTargetUpdateManyMutationInput, {nullable:false}) @Field(() => CommentThreadTargetUpdateManyMutationInput, {nullable:false})
@Type(() => CommentThreadTargetUpdateManyMutationInput) @Type(() => CommentThreadTargetUpdateManyMutationInput)
@ValidateNested({each: true})
@Type(() => CommentThreadTargetUpdateManyMutationInput) @Type(() => CommentThreadTargetUpdateManyMutationInput)
@ValidateNested({each: true})
data!: CommentThreadTargetUpdateManyMutationInput; data!: CommentThreadTargetUpdateManyMutationInput;
@Field(() => CommentThreadTargetWhereInput, {nullable:true}) @Field(() => CommentThreadTargetWhereInput, {nullable:true})

View File

@ -10,8 +10,8 @@ export class UpdateOneCommentThreadTargetArgs {
@Field(() => CommentThreadTargetUpdateInput, {nullable:false}) @Field(() => CommentThreadTargetUpdateInput, {nullable:false})
@Type(() => CommentThreadTargetUpdateInput) @Type(() => CommentThreadTargetUpdateInput)
@ValidateNested({each: true})
@Type(() => CommentThreadTargetUpdateInput) @Type(() => CommentThreadTargetUpdateInput)
@ValidateNested({each: true})
data!: CommentThreadTargetUpdateInput; data!: CommentThreadTargetUpdateInput;
@Field(() => CommentThreadTargetWhereUniqueInput, {nullable:false}) @Field(() => CommentThreadTargetWhereUniqueInput, {nullable:false})

View File

@ -9,8 +9,8 @@ export class CreateManyCommentThreadArgs {
@Field(() => [CommentThreadCreateManyInput], {nullable:false}) @Field(() => [CommentThreadCreateManyInput], {nullable:false})
@Type(() => CommentThreadCreateManyInput) @Type(() => CommentThreadCreateManyInput)
@ValidateNested({each: true})
@Type(() => CommentThreadCreateManyInput) @Type(() => CommentThreadCreateManyInput)
@ValidateNested({each: true})
data!: Array<CommentThreadCreateManyInput>; data!: Array<CommentThreadCreateManyInput>;
@Field(() => Boolean, {nullable:true}) @Field(() => Boolean, {nullable:true})

View File

@ -9,7 +9,7 @@ export class CreateOneCommentThreadArgs {
@Field(() => CommentThreadCreateInput, {nullable:false}) @Field(() => CommentThreadCreateInput, {nullable:false})
@Type(() => CommentThreadCreateInput) @Type(() => CommentThreadCreateInput)
@ValidateNested({each: true})
@Type(() => CommentThreadCreateInput) @Type(() => CommentThreadCreateInput)
@ValidateNested({each: true})
data!: CommentThreadCreateInput; data!: CommentThreadCreateInput;
} }

View File

@ -10,8 +10,8 @@ export class UpdateManyCommentThreadArgs {
@Field(() => CommentThreadUpdateManyMutationInput, {nullable:false}) @Field(() => CommentThreadUpdateManyMutationInput, {nullable:false})
@Type(() => CommentThreadUpdateManyMutationInput) @Type(() => CommentThreadUpdateManyMutationInput)
@ValidateNested({each: true})
@Type(() => CommentThreadUpdateManyMutationInput) @Type(() => CommentThreadUpdateManyMutationInput)
@ValidateNested({each: true})
data!: CommentThreadUpdateManyMutationInput; data!: CommentThreadUpdateManyMutationInput;
@Field(() => CommentThreadWhereInput, {nullable:true}) @Field(() => CommentThreadWhereInput, {nullable:true})

View File

@ -10,8 +10,8 @@ export class UpdateOneCommentThreadArgs {
@Field(() => CommentThreadUpdateInput, {nullable:false}) @Field(() => CommentThreadUpdateInput, {nullable:false})
@Type(() => CommentThreadUpdateInput) @Type(() => CommentThreadUpdateInput)
@ValidateNested({each: true})
@Type(() => CommentThreadUpdateInput) @Type(() => CommentThreadUpdateInput)
@ValidateNested({each: true})
data!: CommentThreadUpdateInput; data!: CommentThreadUpdateInput;
@Field(() => CommentThreadWhereUniqueInput, {nullable:false}) @Field(() => CommentThreadWhereUniqueInput, {nullable:false})

View File

@ -9,8 +9,8 @@ export class CreateManyCommentArgs {
@Field(() => [CommentCreateManyInput], {nullable:false}) @Field(() => [CommentCreateManyInput], {nullable:false})
@Type(() => CommentCreateManyInput) @Type(() => CommentCreateManyInput)
@ValidateNested({each: true})
@Type(() => CommentCreateManyInput) @Type(() => CommentCreateManyInput)
@ValidateNested({each: true})
data!: Array<CommentCreateManyInput>; data!: Array<CommentCreateManyInput>;
@Field(() => Boolean, {nullable:true}) @Field(() => Boolean, {nullable:true})

View File

@ -9,7 +9,7 @@ export class CreateOneCommentArgs {
@Field(() => CommentCreateInput, {nullable:false}) @Field(() => CommentCreateInput, {nullable:false})
@Type(() => CommentCreateInput) @Type(() => CommentCreateInput)
@ValidateNested({each: true})
@Type(() => CommentCreateInput) @Type(() => CommentCreateInput)
@ValidateNested({each: true})
data!: CommentCreateInput; data!: CommentCreateInput;
} }

View File

@ -10,8 +10,8 @@ export class UpdateManyCommentArgs {
@Field(() => CommentUpdateManyMutationInput, {nullable:false}) @Field(() => CommentUpdateManyMutationInput, {nullable:false})
@Type(() => CommentUpdateManyMutationInput) @Type(() => CommentUpdateManyMutationInput)
@ValidateNested({each: true})
@Type(() => CommentUpdateManyMutationInput) @Type(() => CommentUpdateManyMutationInput)
@ValidateNested({each: true})
data!: CommentUpdateManyMutationInput; data!: CommentUpdateManyMutationInput;
@Field(() => CommentWhereInput, {nullable:true}) @Field(() => CommentWhereInput, {nullable:true})

View File

@ -10,8 +10,8 @@ export class UpdateOneCommentArgs {
@Field(() => CommentUpdateInput, {nullable:false}) @Field(() => CommentUpdateInput, {nullable:false})
@Type(() => CommentUpdateInput) @Type(() => CommentUpdateInput)
@ValidateNested({each: true})
@Type(() => CommentUpdateInput) @Type(() => CommentUpdateInput)
@ValidateNested({each: true})
data!: CommentUpdateInput; data!: CommentUpdateInput;
@Field(() => CommentWhereUniqueInput, {nullable:false}) @Field(() => CommentWhereUniqueInput, {nullable:false})

View File

@ -9,8 +9,8 @@ export class CreateManyCompanyArgs {
@Field(() => [CompanyCreateManyInput], {nullable:false}) @Field(() => [CompanyCreateManyInput], {nullable:false})
@Type(() => CompanyCreateManyInput) @Type(() => CompanyCreateManyInput)
@ValidateNested({each: true})
@Type(() => CompanyCreateManyInput) @Type(() => CompanyCreateManyInput)
@ValidateNested({each: true})
data!: Array<CompanyCreateManyInput>; data!: Array<CompanyCreateManyInput>;
@Field(() => Boolean, {nullable:true}) @Field(() => Boolean, {nullable:true})

View File

@ -9,7 +9,7 @@ export class CreateOneCompanyArgs {
@Field(() => CompanyCreateInput, {nullable:false}) @Field(() => CompanyCreateInput, {nullable:false})
@Type(() => CompanyCreateInput) @Type(() => CompanyCreateInput)
@ValidateNested({each: true})
@Type(() => CompanyCreateInput) @Type(() => CompanyCreateInput)
@ValidateNested({each: true})
data!: CompanyCreateInput; data!: CompanyCreateInput;
} }

View File

@ -10,8 +10,8 @@ export class UpdateManyCompanyArgs {
@Field(() => CompanyUpdateManyMutationInput, {nullable:false}) @Field(() => CompanyUpdateManyMutationInput, {nullable:false})
@Type(() => CompanyUpdateManyMutationInput) @Type(() => CompanyUpdateManyMutationInput)
@ValidateNested({each: true})
@Type(() => CompanyUpdateManyMutationInput) @Type(() => CompanyUpdateManyMutationInput)
@ValidateNested({each: true})
data!: CompanyUpdateManyMutationInput; data!: CompanyUpdateManyMutationInput;
@Field(() => CompanyWhereInput, {nullable:true}) @Field(() => CompanyWhereInput, {nullable:true})

View File

@ -10,8 +10,8 @@ export class UpdateOneCompanyArgs {
@Field(() => CompanyUpdateInput, {nullable:false}) @Field(() => CompanyUpdateInput, {nullable:false})
@Type(() => CompanyUpdateInput) @Type(() => CompanyUpdateInput)
@ValidateNested({each: true})
@Type(() => CompanyUpdateInput) @Type(() => CompanyUpdateInput)
@ValidateNested({each: true})
data!: CompanyUpdateInput; data!: CompanyUpdateInput;
@Field(() => CompanyWhereUniqueInput, {nullable:false}) @Field(() => CompanyWhereUniqueInput, {nullable:false})

View File

@ -9,8 +9,8 @@ export class CreateManyPersonArgs {
@Field(() => [PersonCreateManyInput], {nullable:false}) @Field(() => [PersonCreateManyInput], {nullable:false})
@Type(() => PersonCreateManyInput) @Type(() => PersonCreateManyInput)
@ValidateNested({each: true})
@Type(() => PersonCreateManyInput) @Type(() => PersonCreateManyInput)
@ValidateNested({each: true})
data!: Array<PersonCreateManyInput>; data!: Array<PersonCreateManyInput>;
@Field(() => Boolean, {nullable:true}) @Field(() => Boolean, {nullable:true})

View File

@ -9,7 +9,7 @@ export class CreateOnePersonArgs {
@Field(() => PersonCreateInput, {nullable:false}) @Field(() => PersonCreateInput, {nullable:false})
@Type(() => PersonCreateInput) @Type(() => PersonCreateInput)
@ValidateNested({each: true})
@Type(() => PersonCreateInput) @Type(() => PersonCreateInput)
@ValidateNested({each: true})
data!: PersonCreateInput; data!: PersonCreateInput;
} }

View File

@ -10,8 +10,8 @@ export class UpdateManyPersonArgs {
@Field(() => PersonUpdateManyMutationInput, {nullable:false}) @Field(() => PersonUpdateManyMutationInput, {nullable:false})
@Type(() => PersonUpdateManyMutationInput) @Type(() => PersonUpdateManyMutationInput)
@ValidateNested({each: true})
@Type(() => PersonUpdateManyMutationInput) @Type(() => PersonUpdateManyMutationInput)
@ValidateNested({each: true})
data!: PersonUpdateManyMutationInput; data!: PersonUpdateManyMutationInput;
@Field(() => PersonWhereInput, {nullable:true}) @Field(() => PersonWhereInput, {nullable:true})

View File

@ -10,8 +10,8 @@ export class UpdateOnePersonArgs {
@Field(() => PersonUpdateInput, {nullable:false}) @Field(() => PersonUpdateInput, {nullable:false})
@Type(() => PersonUpdateInput) @Type(() => PersonUpdateInput)
@ValidateNested({each: true})
@Type(() => PersonUpdateInput) @Type(() => PersonUpdateInput)
@ValidateNested({each: true})
data!: PersonUpdateInput; data!: PersonUpdateInput;
@Field(() => PersonWhereUniqueInput, {nullable:false}) @Field(() => PersonWhereUniqueInput, {nullable:false})

View File

@ -9,8 +9,8 @@ export class CreateManyPipelineProgressArgs {
@Field(() => [PipelineProgressCreateManyInput], {nullable:false}) @Field(() => [PipelineProgressCreateManyInput], {nullable:false})
@Type(() => PipelineProgressCreateManyInput) @Type(() => PipelineProgressCreateManyInput)
@ValidateNested({each: true})
@Type(() => PipelineProgressCreateManyInput) @Type(() => PipelineProgressCreateManyInput)
@ValidateNested({each: true})
data!: Array<PipelineProgressCreateManyInput>; data!: Array<PipelineProgressCreateManyInput>;
@Field(() => Boolean, {nullable:true}) @Field(() => Boolean, {nullable:true})

View File

@ -9,7 +9,7 @@ export class CreateOnePipelineProgressArgs {
@Field(() => PipelineProgressCreateInput, {nullable:false}) @Field(() => PipelineProgressCreateInput, {nullable:false})
@Type(() => PipelineProgressCreateInput) @Type(() => PipelineProgressCreateInput)
@ValidateNested({each: true})
@Type(() => PipelineProgressCreateInput) @Type(() => PipelineProgressCreateInput)
@ValidateNested({each: true})
data!: PipelineProgressCreateInput; data!: PipelineProgressCreateInput;
} }

View File

@ -10,8 +10,8 @@ export class UpdateManyPipelineProgressArgs {
@Field(() => PipelineProgressUpdateManyMutationInput, {nullable:false}) @Field(() => PipelineProgressUpdateManyMutationInput, {nullable:false})
@Type(() => PipelineProgressUpdateManyMutationInput) @Type(() => PipelineProgressUpdateManyMutationInput)
@ValidateNested({each: true})
@Type(() => PipelineProgressUpdateManyMutationInput) @Type(() => PipelineProgressUpdateManyMutationInput)
@ValidateNested({each: true})
data!: PipelineProgressUpdateManyMutationInput; data!: PipelineProgressUpdateManyMutationInput;
@Field(() => PipelineProgressWhereInput, {nullable:true}) @Field(() => PipelineProgressWhereInput, {nullable:true})

View File

@ -10,8 +10,8 @@ export class UpdateOnePipelineProgressArgs {
@Field(() => PipelineProgressUpdateInput, {nullable:false}) @Field(() => PipelineProgressUpdateInput, {nullable:false})
@Type(() => PipelineProgressUpdateInput) @Type(() => PipelineProgressUpdateInput)
@ValidateNested({each: true})
@Type(() => PipelineProgressUpdateInput) @Type(() => PipelineProgressUpdateInput)
@ValidateNested({each: true})
data!: PipelineProgressUpdateInput; data!: PipelineProgressUpdateInput;
@Field(() => PipelineProgressWhereUniqueInput, {nullable:false}) @Field(() => PipelineProgressWhereUniqueInput, {nullable:false})

View File

@ -9,8 +9,8 @@ export class CreateManyPipelineStageArgs {
@Field(() => [PipelineStageCreateManyInput], {nullable:false}) @Field(() => [PipelineStageCreateManyInput], {nullable:false})
@Type(() => PipelineStageCreateManyInput) @Type(() => PipelineStageCreateManyInput)
@ValidateNested({each: true})
@Type(() => PipelineStageCreateManyInput) @Type(() => PipelineStageCreateManyInput)
@ValidateNested({each: true})
data!: Array<PipelineStageCreateManyInput>; data!: Array<PipelineStageCreateManyInput>;
@Field(() => Boolean, {nullable:true}) @Field(() => Boolean, {nullable:true})

View File

@ -9,7 +9,7 @@ export class CreateOnePipelineStageArgs {
@Field(() => PipelineStageCreateInput, {nullable:false}) @Field(() => PipelineStageCreateInput, {nullable:false})
@Type(() => PipelineStageCreateInput) @Type(() => PipelineStageCreateInput)
@ValidateNested({each: true})
@Type(() => PipelineStageCreateInput) @Type(() => PipelineStageCreateInput)
@ValidateNested({each: true})
data!: PipelineStageCreateInput; data!: PipelineStageCreateInput;
} }

View File

@ -10,8 +10,8 @@ export class UpdateManyPipelineStageArgs {
@Field(() => PipelineStageUpdateManyMutationInput, {nullable:false}) @Field(() => PipelineStageUpdateManyMutationInput, {nullable:false})
@Type(() => PipelineStageUpdateManyMutationInput) @Type(() => PipelineStageUpdateManyMutationInput)
@ValidateNested({each: true})
@Type(() => PipelineStageUpdateManyMutationInput) @Type(() => PipelineStageUpdateManyMutationInput)
@ValidateNested({each: true})
data!: PipelineStageUpdateManyMutationInput; data!: PipelineStageUpdateManyMutationInput;
@Field(() => PipelineStageWhereInput, {nullable:true}) @Field(() => PipelineStageWhereInput, {nullable:true})

View File

@ -10,8 +10,8 @@ export class UpdateOnePipelineStageArgs {
@Field(() => PipelineStageUpdateInput, {nullable:false}) @Field(() => PipelineStageUpdateInput, {nullable:false})
@Type(() => PipelineStageUpdateInput) @Type(() => PipelineStageUpdateInput)
@ValidateNested({each: true})
@Type(() => PipelineStageUpdateInput) @Type(() => PipelineStageUpdateInput)
@ValidateNested({each: true})
data!: PipelineStageUpdateInput; data!: PipelineStageUpdateInput;
@Field(() => PipelineStageWhereUniqueInput, {nullable:false}) @Field(() => PipelineStageWhereUniqueInput, {nullable:false})

View File

@ -9,8 +9,8 @@ export class CreateManyPipelineArgs {
@Field(() => [PipelineCreateManyInput], {nullable:false}) @Field(() => [PipelineCreateManyInput], {nullable:false})
@Type(() => PipelineCreateManyInput) @Type(() => PipelineCreateManyInput)
@ValidateNested({each: true})
@Type(() => PipelineCreateManyInput) @Type(() => PipelineCreateManyInput)
@ValidateNested({each: true})
data!: Array<PipelineCreateManyInput>; data!: Array<PipelineCreateManyInput>;
@Field(() => Boolean, {nullable:true}) @Field(() => Boolean, {nullable:true})

View File

@ -9,7 +9,7 @@ export class CreateOnePipelineArgs {
@Field(() => PipelineCreateInput, {nullable:false}) @Field(() => PipelineCreateInput, {nullable:false})
@Type(() => PipelineCreateInput) @Type(() => PipelineCreateInput)
@ValidateNested({each: true})
@Type(() => PipelineCreateInput) @Type(() => PipelineCreateInput)
@ValidateNested({each: true})
data!: PipelineCreateInput; data!: PipelineCreateInput;
} }

View File

@ -10,8 +10,8 @@ export class UpdateManyPipelineArgs {
@Field(() => PipelineUpdateManyMutationInput, {nullable:false}) @Field(() => PipelineUpdateManyMutationInput, {nullable:false})
@Type(() => PipelineUpdateManyMutationInput) @Type(() => PipelineUpdateManyMutationInput)
@ValidateNested({each: true})
@Type(() => PipelineUpdateManyMutationInput) @Type(() => PipelineUpdateManyMutationInput)
@ValidateNested({each: true})
data!: PipelineUpdateManyMutationInput; data!: PipelineUpdateManyMutationInput;
@Field(() => PipelineWhereInput, {nullable:true}) @Field(() => PipelineWhereInput, {nullable:true})

View File

@ -10,8 +10,8 @@ export class UpdateOnePipelineArgs {
@Field(() => PipelineUpdateInput, {nullable:false}) @Field(() => PipelineUpdateInput, {nullable:false})
@Type(() => PipelineUpdateInput) @Type(() => PipelineUpdateInput)
@ValidateNested({each: true})
@Type(() => PipelineUpdateInput) @Type(() => PipelineUpdateInput)
@ValidateNested({each: true})
data!: PipelineUpdateInput; data!: PipelineUpdateInput;
@Field(() => PipelineWhereUniqueInput, {nullable:false}) @Field(() => PipelineWhereUniqueInput, {nullable:false})

View File

@ -9,8 +9,8 @@ export class CreateManyRefreshTokenArgs {
@Field(() => [RefreshTokenCreateManyInput], {nullable:false}) @Field(() => [RefreshTokenCreateManyInput], {nullable:false})
@Type(() => RefreshTokenCreateManyInput) @Type(() => RefreshTokenCreateManyInput)
@ValidateNested({each: true})
@Type(() => RefreshTokenCreateManyInput) @Type(() => RefreshTokenCreateManyInput)
@ValidateNested({each: true})
data!: Array<RefreshTokenCreateManyInput>; data!: Array<RefreshTokenCreateManyInput>;
@Field(() => Boolean, {nullable:true}) @Field(() => Boolean, {nullable:true})

View File

@ -9,7 +9,7 @@ export class CreateOneRefreshTokenArgs {
@Field(() => RefreshTokenCreateInput, {nullable:false}) @Field(() => RefreshTokenCreateInput, {nullable:false})
@Type(() => RefreshTokenCreateInput) @Type(() => RefreshTokenCreateInput)
@ValidateNested({each: true})
@Type(() => RefreshTokenCreateInput) @Type(() => RefreshTokenCreateInput)
@ValidateNested({each: true})
data!: RefreshTokenCreateInput; data!: RefreshTokenCreateInput;
} }

View File

@ -10,8 +10,8 @@ export class UpdateManyRefreshTokenArgs {
@Field(() => RefreshTokenUpdateManyMutationInput, {nullable:false}) @Field(() => RefreshTokenUpdateManyMutationInput, {nullable:false})
@Type(() => RefreshTokenUpdateManyMutationInput) @Type(() => RefreshTokenUpdateManyMutationInput)
@ValidateNested({each: true})
@Type(() => RefreshTokenUpdateManyMutationInput) @Type(() => RefreshTokenUpdateManyMutationInput)
@ValidateNested({each: true})
data!: RefreshTokenUpdateManyMutationInput; data!: RefreshTokenUpdateManyMutationInput;
@Field(() => RefreshTokenWhereInput, {nullable:true}) @Field(() => RefreshTokenWhereInput, {nullable:true})

View File

@ -10,8 +10,8 @@ export class UpdateOneRefreshTokenArgs {
@Field(() => RefreshTokenUpdateInput, {nullable:false}) @Field(() => RefreshTokenUpdateInput, {nullable:false})
@Type(() => RefreshTokenUpdateInput) @Type(() => RefreshTokenUpdateInput)
@ValidateNested({each: true})
@Type(() => RefreshTokenUpdateInput) @Type(() => RefreshTokenUpdateInput)
@ValidateNested({each: true})
data!: RefreshTokenUpdateInput; data!: RefreshTokenUpdateInput;
@Field(() => RefreshTokenWhereUniqueInput, {nullable:false}) @Field(() => RefreshTokenWhereUniqueInput, {nullable:false})

View File

@ -9,8 +9,8 @@ export class CreateManyUserArgs {
@Field(() => [UserCreateManyInput], {nullable:false}) @Field(() => [UserCreateManyInput], {nullable:false})
@Type(() => UserCreateManyInput) @Type(() => UserCreateManyInput)
@ValidateNested({each: true})
@Type(() => UserCreateManyInput) @Type(() => UserCreateManyInput)
@ValidateNested({each: true})
data!: Array<UserCreateManyInput>; data!: Array<UserCreateManyInput>;
@Field(() => Boolean, {nullable:true}) @Field(() => Boolean, {nullable:true})

View File

@ -9,7 +9,7 @@ export class CreateOneUserArgs {
@Field(() => UserCreateInput, {nullable:false}) @Field(() => UserCreateInput, {nullable:false})
@Type(() => UserCreateInput) @Type(() => UserCreateInput)
@ValidateNested({each: true})
@Type(() => UserCreateInput) @Type(() => UserCreateInput)
@ValidateNested({each: true})
data!: UserCreateInput; data!: UserCreateInput;
} }

View File

@ -10,8 +10,8 @@ export class UpdateManyUserArgs {
@Field(() => UserUpdateManyMutationInput, {nullable:false}) @Field(() => UserUpdateManyMutationInput, {nullable:false})
@Type(() => UserUpdateManyMutationInput) @Type(() => UserUpdateManyMutationInput)
@ValidateNested({each: true})
@Type(() => UserUpdateManyMutationInput) @Type(() => UserUpdateManyMutationInput)
@ValidateNested({each: true})
data!: UserUpdateManyMutationInput; data!: UserUpdateManyMutationInput;
@Field(() => UserWhereInput, {nullable:true}) @Field(() => UserWhereInput, {nullable:true})

View File

@ -10,8 +10,8 @@ export class UpdateOneUserArgs {
@Field(() => UserUpdateInput, {nullable:false}) @Field(() => UserUpdateInput, {nullable:false})
@Type(() => UserUpdateInput) @Type(() => UserUpdateInput)
@ValidateNested({each: true})
@Type(() => UserUpdateInput) @Type(() => UserUpdateInput)
@ValidateNested({each: true})
data!: UserUpdateInput; data!: UserUpdateInput;
@Field(() => UserWhereUniqueInput, {nullable:false}) @Field(() => UserWhereUniqueInput, {nullable:false})

View File

@ -14,9 +14,6 @@ export class UserCountAggregateInput {
@Field(() => Boolean, {nullable:true}) @Field(() => Boolean, {nullable:true})
lastName?: true; lastName?: true;
@Field(() => Boolean, {nullable:true})
displayName?: true;
@Field(() => Boolean, {nullable:true}) @Field(() => Boolean, {nullable:true})
email?: true; email?: true;

View File

@ -15,9 +15,6 @@ export class UserCountAggregate {
@Field(() => Int, {nullable:false}) @Field(() => Int, {nullable:false})
lastName!: number; lastName!: number;
@HideField()
displayName!: number;
@Field(() => Int, {nullable:false}) @Field(() => Int, {nullable:false})
email!: number; email!: number;

View File

@ -15,9 +15,6 @@ export class UserCountOrderByAggregateInput {
@Field(() => SortOrder, {nullable:true}) @Field(() => SortOrder, {nullable:true})
lastName?: keyof typeof SortOrder; lastName?: keyof typeof SortOrder;
@Field(() => SortOrder, {nullable:true})
displayName?: keyof typeof SortOrder;
@Field(() => SortOrder, {nullable:true}) @Field(() => SortOrder, {nullable:true})
email?: keyof typeof SortOrder; email?: keyof typeof SortOrder;

View File

@ -20,11 +20,6 @@ export class UserCreateManyInput {
@Validator.IsString() @Validator.IsString()
lastName!: string; lastName!: string;
@Field(() => String, {nullable:true})
@Validator.IsString()
@Validator.IsOptional()
displayName?: string;
@Field(() => String, {nullable:false}) @Field(() => String, {nullable:false})
@Validator.IsEmail() @Validator.IsEmail()
email!: string; email!: string;

View File

@ -23,11 +23,6 @@ export class UserCreateWithoutCommentsInput {
@Validator.IsString() @Validator.IsString()
lastName!: string; lastName!: string;
@Field(() => String, {nullable:true})
@Validator.IsString()
@Validator.IsOptional()
displayName?: string;
@Field(() => String, {nullable:false}) @Field(() => String, {nullable:false})
@Validator.IsEmail() @Validator.IsEmail()
email!: string; email!: string;

View File

@ -23,11 +23,6 @@ export class UserCreateWithoutCompaniesInput {
@Validator.IsString() @Validator.IsString()
lastName!: string; lastName!: string;
@Field(() => String, {nullable:true})
@Validator.IsString()
@Validator.IsOptional()
displayName?: string;
@Field(() => String, {nullable:false}) @Field(() => String, {nullable:false})
@Validator.IsEmail() @Validator.IsEmail()
email!: string; email!: string;

View File

@ -23,11 +23,6 @@ export class UserCreateWithoutRefreshTokensInput {
@Validator.IsString() @Validator.IsString()
lastName!: string; lastName!: string;
@Field(() => String, {nullable:true})
@Validator.IsString()
@Validator.IsOptional()
displayName?: string;
@Field(() => String, {nullable:false}) @Field(() => String, {nullable:false})
@Validator.IsEmail() @Validator.IsEmail()
email!: string; email!: string;

View File

@ -23,11 +23,6 @@ export class UserCreateWithoutWorkspaceMemberInput {
@Validator.IsString() @Validator.IsString()
lastName!: string; lastName!: string;
@Field(() => String, {nullable:true})
@Validator.IsString()
@Validator.IsOptional()
displayName?: string;
@Field(() => String, {nullable:false}) @Field(() => String, {nullable:false})
@Validator.IsEmail() @Validator.IsEmail()
email!: string; email!: string;

View File

@ -24,11 +24,6 @@ export class UserCreateInput {
@Validator.IsString() @Validator.IsString()
lastName!: string; lastName!: string;
@Field(() => String, {nullable:true})
@Validator.IsString()
@Validator.IsOptional()
displayName?: string;
@Field(() => String, {nullable:false}) @Field(() => String, {nullable:false})
@Validator.IsEmail() @Validator.IsEmail()
email!: string; email!: string;

View File

@ -23,9 +23,6 @@ export class UserGroupBy {
@Validator.IsString() @Validator.IsString()
lastName!: string; lastName!: string;
@HideField()
displayName?: string;
@Field(() => String, {nullable:false}) @Field(() => String, {nullable:false})
@Validator.IsEmail() @Validator.IsEmail()
email!: string; email!: string;

View File

@ -14,9 +14,6 @@ export class UserMaxAggregateInput {
@Field(() => Boolean, {nullable:true}) @Field(() => Boolean, {nullable:true})
lastName?: true; lastName?: true;
@Field(() => Boolean, {nullable:true})
displayName?: true;
@Field(() => Boolean, {nullable:true}) @Field(() => Boolean, {nullable:true})
email?: true; email?: true;

View File

@ -19,9 +19,6 @@ export class UserMaxAggregate {
@Validator.IsString() @Validator.IsString()
lastName?: string; lastName?: string;
@HideField()
displayName?: string;
@Field(() => String, {nullable:true}) @Field(() => String, {nullable:true})
@Validator.IsEmail() @Validator.IsEmail()
email?: string; email?: string;

View File

@ -15,9 +15,6 @@ export class UserMaxOrderByAggregateInput {
@Field(() => SortOrder, {nullable:true}) @Field(() => SortOrder, {nullable:true})
lastName?: keyof typeof SortOrder; lastName?: keyof typeof SortOrder;
@Field(() => SortOrder, {nullable:true})
displayName?: keyof typeof SortOrder;
@Field(() => SortOrder, {nullable:true}) @Field(() => SortOrder, {nullable:true})
email?: keyof typeof SortOrder; email?: keyof typeof SortOrder;

View File

@ -14,9 +14,6 @@ export class UserMinAggregateInput {
@Field(() => Boolean, {nullable:true}) @Field(() => Boolean, {nullable:true})
lastName?: true; lastName?: true;
@Field(() => Boolean, {nullable:true})
displayName?: true;
@Field(() => Boolean, {nullable:true}) @Field(() => Boolean, {nullable:true})
email?: true; email?: true;

View File

@ -19,9 +19,6 @@ export class UserMinAggregate {
@Validator.IsString() @Validator.IsString()
lastName?: string; lastName?: string;
@HideField()
displayName?: string;
@Field(() => String, {nullable:true}) @Field(() => String, {nullable:true})
@Validator.IsEmail() @Validator.IsEmail()
email?: string; email?: string;

View File

@ -15,9 +15,6 @@ export class UserMinOrderByAggregateInput {
@Field(() => SortOrder, {nullable:true}) @Field(() => SortOrder, {nullable:true})
lastName?: keyof typeof SortOrder; lastName?: keyof typeof SortOrder;
@Field(() => SortOrder, {nullable:true})
displayName?: keyof typeof SortOrder;
@Field(() => SortOrder, {nullable:true}) @Field(() => SortOrder, {nullable:true})
email?: keyof typeof SortOrder; email?: keyof typeof SortOrder;

View File

@ -18,9 +18,6 @@ export class UserOrderByWithAggregationInput {
@Field(() => SortOrder, {nullable:true}) @Field(() => SortOrder, {nullable:true})
lastName?: keyof typeof SortOrder; lastName?: keyof typeof SortOrder;
@Field(() => SortOrder, {nullable:true})
displayName?: keyof typeof SortOrder;
@Field(() => SortOrder, {nullable:true}) @Field(() => SortOrder, {nullable:true})
email?: keyof typeof SortOrder; email?: keyof typeof SortOrder;

View File

@ -19,9 +19,6 @@ export class UserOrderByWithRelationInput {
@Field(() => SortOrder, {nullable:true}) @Field(() => SortOrder, {nullable:true})
lastName?: keyof typeof SortOrder; lastName?: keyof typeof SortOrder;
@Field(() => SortOrder, {nullable:true})
displayName?: keyof typeof SortOrder;
@Field(() => SortOrder, {nullable:true}) @Field(() => SortOrder, {nullable:true})
email?: keyof typeof SortOrder; email?: keyof typeof SortOrder;

View File

@ -4,7 +4,6 @@ export enum UserScalarFieldEnum {
id = "id", id = "id",
firstName = "firstName", firstName = "firstName",
lastName = "lastName", lastName = "lastName",
displayName = "displayName",
email = "email", email = "email",
emailVerified = "emailVerified", emailVerified = "emailVerified",
avatarUrl = "avatarUrl", avatarUrl = "avatarUrl",

View File

@ -1,8 +1,8 @@
import { Field } from '@nestjs/graphql'; import { Field } from '@nestjs/graphql';
import { InputType } from '@nestjs/graphql'; import { InputType } from '@nestjs/graphql';
import { StringWithAggregatesFilter } from '../prisma/string-with-aggregates-filter.input'; import { StringWithAggregatesFilter } from '../prisma/string-with-aggregates-filter.input';
import { StringNullableWithAggregatesFilter } from '../prisma/string-nullable-with-aggregates-filter.input';
import { BoolWithAggregatesFilter } from '../prisma/bool-with-aggregates-filter.input'; import { BoolWithAggregatesFilter } from '../prisma/bool-with-aggregates-filter.input';
import { StringNullableWithAggregatesFilter } from '../prisma/string-nullable-with-aggregates-filter.input';
import { DateTimeNullableWithAggregatesFilter } from '../prisma/date-time-nullable-with-aggregates-filter.input'; import { DateTimeNullableWithAggregatesFilter } from '../prisma/date-time-nullable-with-aggregates-filter.input';
import { HideField } from '@nestjs/graphql'; import { HideField } from '@nestjs/graphql';
import { JsonNullableWithAggregatesFilter } from '../prisma/json-nullable-with-aggregates-filter.input'; import { JsonNullableWithAggregatesFilter } from '../prisma/json-nullable-with-aggregates-filter.input';
@ -29,9 +29,6 @@ export class UserScalarWhereWithAggregatesInput {
@Field(() => StringWithAggregatesFilter, {nullable:true}) @Field(() => StringWithAggregatesFilter, {nullable:true})
lastName?: StringWithAggregatesFilter; lastName?: StringWithAggregatesFilter;
@Field(() => StringNullableWithAggregatesFilter, {nullable:true})
displayName?: StringNullableWithAggregatesFilter;
@Field(() => StringWithAggregatesFilter, {nullable:true}) @Field(() => StringWithAggregatesFilter, {nullable:true})
email?: StringWithAggregatesFilter; email?: StringWithAggregatesFilter;

View File

@ -23,11 +23,6 @@ export class UserUncheckedCreateWithoutCommentsInput {
@Validator.IsString() @Validator.IsString()
lastName!: string; lastName!: string;
@Field(() => String, {nullable:true})
@Validator.IsString()
@Validator.IsOptional()
displayName?: string;
@Field(() => String, {nullable:false}) @Field(() => String, {nullable:false})
@Validator.IsEmail() @Validator.IsEmail()
email!: string; email!: string;

View File

@ -23,11 +23,6 @@ export class UserUncheckedCreateWithoutCompaniesInput {
@Validator.IsString() @Validator.IsString()
lastName!: string; lastName!: string;
@Field(() => String, {nullable:true})
@Validator.IsString()
@Validator.IsOptional()
displayName?: string;
@Field(() => String, {nullable:false}) @Field(() => String, {nullable:false})
@Validator.IsEmail() @Validator.IsEmail()
email!: string; email!: string;

View File

@ -23,11 +23,6 @@ export class UserUncheckedCreateWithoutRefreshTokensInput {
@Validator.IsString() @Validator.IsString()
lastName!: string; lastName!: string;
@Field(() => String, {nullable:true})
@Validator.IsString()
@Validator.IsOptional()
displayName?: string;
@Field(() => String, {nullable:false}) @Field(() => String, {nullable:false})
@Validator.IsEmail() @Validator.IsEmail()
email!: string; email!: string;

View File

@ -23,11 +23,6 @@ export class UserUncheckedCreateWithoutWorkspaceMemberInput {
@Validator.IsString() @Validator.IsString()
lastName!: string; lastName!: string;
@Field(() => String, {nullable:true})
@Validator.IsString()
@Validator.IsOptional()
displayName?: string;
@Field(() => String, {nullable:false}) @Field(() => String, {nullable:false})
@Validator.IsEmail() @Validator.IsEmail()
email!: string; email!: string;

View File

@ -24,11 +24,6 @@ export class UserUncheckedCreateInput {
@Validator.IsString() @Validator.IsString()
lastName!: string; lastName!: string;
@Field(() => String, {nullable:true})
@Validator.IsString()
@Validator.IsOptional()
displayName?: string;
@Field(() => String, {nullable:false}) @Field(() => String, {nullable:false})
@Validator.IsEmail() @Validator.IsEmail()
email!: string; email!: string;

View File

@ -1,8 +1,8 @@
import { Field } from '@nestjs/graphql'; import { Field } from '@nestjs/graphql';
import { InputType } from '@nestjs/graphql'; import { InputType } from '@nestjs/graphql';
import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input'; import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input';
import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input';
import { BoolFieldUpdateOperationsInput } from '../prisma/bool-field-update-operations.input'; import { BoolFieldUpdateOperationsInput } from '../prisma/bool-field-update-operations.input';
import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input';
import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input'; import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input';
import { HideField } from '@nestjs/graphql'; import { HideField } from '@nestjs/graphql';
import { GraphQLJSON } from 'graphql-type-json'; import { GraphQLJSON } from 'graphql-type-json';
@ -21,9 +21,6 @@ export class UserUncheckedUpdateManyInput {
@Field(() => StringFieldUpdateOperationsInput, {nullable:true}) @Field(() => StringFieldUpdateOperationsInput, {nullable:true})
lastName?: StringFieldUpdateOperationsInput; lastName?: StringFieldUpdateOperationsInput;
@Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true})
displayName?: NullableStringFieldUpdateOperationsInput;
@Field(() => StringFieldUpdateOperationsInput, {nullable:true}) @Field(() => StringFieldUpdateOperationsInput, {nullable:true})
email?: StringFieldUpdateOperationsInput; email?: StringFieldUpdateOperationsInput;

View File

@ -1,8 +1,8 @@
import { Field } from '@nestjs/graphql'; import { Field } from '@nestjs/graphql';
import { InputType } from '@nestjs/graphql'; import { InputType } from '@nestjs/graphql';
import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input'; import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input';
import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input';
import { BoolFieldUpdateOperationsInput } from '../prisma/bool-field-update-operations.input'; import { BoolFieldUpdateOperationsInput } from '../prisma/bool-field-update-operations.input';
import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input';
import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input'; import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input';
import { HideField } from '@nestjs/graphql'; import { HideField } from '@nestjs/graphql';
import { GraphQLJSON } from 'graphql-type-json'; import { GraphQLJSON } from 'graphql-type-json';
@ -24,9 +24,6 @@ export class UserUncheckedUpdateWithoutCommentsInput {
@Field(() => StringFieldUpdateOperationsInput, {nullable:true}) @Field(() => StringFieldUpdateOperationsInput, {nullable:true})
lastName?: StringFieldUpdateOperationsInput; lastName?: StringFieldUpdateOperationsInput;
@Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true})
displayName?: NullableStringFieldUpdateOperationsInput;
@Field(() => StringFieldUpdateOperationsInput, {nullable:true}) @Field(() => StringFieldUpdateOperationsInput, {nullable:true})
email?: StringFieldUpdateOperationsInput; email?: StringFieldUpdateOperationsInput;

View File

@ -1,8 +1,8 @@
import { Field } from '@nestjs/graphql'; import { Field } from '@nestjs/graphql';
import { InputType } from '@nestjs/graphql'; import { InputType } from '@nestjs/graphql';
import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input'; import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input';
import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input';
import { BoolFieldUpdateOperationsInput } from '../prisma/bool-field-update-operations.input'; import { BoolFieldUpdateOperationsInput } from '../prisma/bool-field-update-operations.input';
import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input';
import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input'; import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input';
import { HideField } from '@nestjs/graphql'; import { HideField } from '@nestjs/graphql';
import { GraphQLJSON } from 'graphql-type-json'; import { GraphQLJSON } from 'graphql-type-json';
@ -24,9 +24,6 @@ export class UserUncheckedUpdateWithoutCompaniesInput {
@Field(() => StringFieldUpdateOperationsInput, {nullable:true}) @Field(() => StringFieldUpdateOperationsInput, {nullable:true})
lastName?: StringFieldUpdateOperationsInput; lastName?: StringFieldUpdateOperationsInput;
@Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true})
displayName?: NullableStringFieldUpdateOperationsInput;
@Field(() => StringFieldUpdateOperationsInput, {nullable:true}) @Field(() => StringFieldUpdateOperationsInput, {nullable:true})
email?: StringFieldUpdateOperationsInput; email?: StringFieldUpdateOperationsInput;

View File

@ -1,8 +1,8 @@
import { Field } from '@nestjs/graphql'; import { Field } from '@nestjs/graphql';
import { InputType } from '@nestjs/graphql'; import { InputType } from '@nestjs/graphql';
import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input'; import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input';
import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input';
import { BoolFieldUpdateOperationsInput } from '../prisma/bool-field-update-operations.input'; import { BoolFieldUpdateOperationsInput } from '../prisma/bool-field-update-operations.input';
import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input';
import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input'; import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input';
import { HideField } from '@nestjs/graphql'; import { HideField } from '@nestjs/graphql';
import { GraphQLJSON } from 'graphql-type-json'; import { GraphQLJSON } from 'graphql-type-json';
@ -24,9 +24,6 @@ export class UserUncheckedUpdateWithoutRefreshTokensInput {
@Field(() => StringFieldUpdateOperationsInput, {nullable:true}) @Field(() => StringFieldUpdateOperationsInput, {nullable:true})
lastName?: StringFieldUpdateOperationsInput; lastName?: StringFieldUpdateOperationsInput;
@Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true})
displayName?: NullableStringFieldUpdateOperationsInput;
@Field(() => StringFieldUpdateOperationsInput, {nullable:true}) @Field(() => StringFieldUpdateOperationsInput, {nullable:true})
email?: StringFieldUpdateOperationsInput; email?: StringFieldUpdateOperationsInput;

View File

@ -1,8 +1,8 @@
import { Field } from '@nestjs/graphql'; import { Field } from '@nestjs/graphql';
import { InputType } from '@nestjs/graphql'; import { InputType } from '@nestjs/graphql';
import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input'; import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input';
import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input';
import { BoolFieldUpdateOperationsInput } from '../prisma/bool-field-update-operations.input'; import { BoolFieldUpdateOperationsInput } from '../prisma/bool-field-update-operations.input';
import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input';
import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input'; import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input';
import { HideField } from '@nestjs/graphql'; import { HideField } from '@nestjs/graphql';
import { GraphQLJSON } from 'graphql-type-json'; import { GraphQLJSON } from 'graphql-type-json';
@ -24,9 +24,6 @@ export class UserUncheckedUpdateWithoutWorkspaceMemberInput {
@Field(() => StringFieldUpdateOperationsInput, {nullable:true}) @Field(() => StringFieldUpdateOperationsInput, {nullable:true})
lastName?: StringFieldUpdateOperationsInput; lastName?: StringFieldUpdateOperationsInput;
@Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true})
displayName?: NullableStringFieldUpdateOperationsInput;
@Field(() => StringFieldUpdateOperationsInput, {nullable:true}) @Field(() => StringFieldUpdateOperationsInput, {nullable:true})
email?: StringFieldUpdateOperationsInput; email?: StringFieldUpdateOperationsInput;

View File

@ -1,8 +1,8 @@
import { Field } from '@nestjs/graphql'; import { Field } from '@nestjs/graphql';
import { InputType } from '@nestjs/graphql'; import { InputType } from '@nestjs/graphql';
import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input'; import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input';
import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input';
import { BoolFieldUpdateOperationsInput } from '../prisma/bool-field-update-operations.input'; import { BoolFieldUpdateOperationsInput } from '../prisma/bool-field-update-operations.input';
import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input';
import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input'; import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input';
import { HideField } from '@nestjs/graphql'; import { HideField } from '@nestjs/graphql';
import { GraphQLJSON } from 'graphql-type-json'; import { GraphQLJSON } from 'graphql-type-json';
@ -25,9 +25,6 @@ export class UserUncheckedUpdateInput {
@Field(() => StringFieldUpdateOperationsInput, {nullable:true}) @Field(() => StringFieldUpdateOperationsInput, {nullable:true})
lastName?: StringFieldUpdateOperationsInput; lastName?: StringFieldUpdateOperationsInput;
@Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true})
displayName?: NullableStringFieldUpdateOperationsInput;
@Field(() => StringFieldUpdateOperationsInput, {nullable:true}) @Field(() => StringFieldUpdateOperationsInput, {nullable:true})
email?: StringFieldUpdateOperationsInput; email?: StringFieldUpdateOperationsInput;

View File

@ -1,8 +1,8 @@
import { Field } from '@nestjs/graphql'; import { Field } from '@nestjs/graphql';
import { InputType } from '@nestjs/graphql'; import { InputType } from '@nestjs/graphql';
import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input'; import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input';
import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input';
import { BoolFieldUpdateOperationsInput } from '../prisma/bool-field-update-operations.input'; import { BoolFieldUpdateOperationsInput } from '../prisma/bool-field-update-operations.input';
import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input';
import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input'; import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input';
import { HideField } from '@nestjs/graphql'; import { HideField } from '@nestjs/graphql';
import { GraphQLJSON } from 'graphql-type-json'; import { GraphQLJSON } from 'graphql-type-json';
@ -21,9 +21,6 @@ export class UserUpdateManyMutationInput {
@Field(() => StringFieldUpdateOperationsInput, {nullable:true}) @Field(() => StringFieldUpdateOperationsInput, {nullable:true})
lastName?: StringFieldUpdateOperationsInput; lastName?: StringFieldUpdateOperationsInput;
@Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true})
displayName?: NullableStringFieldUpdateOperationsInput;
@Field(() => StringFieldUpdateOperationsInput, {nullable:true}) @Field(() => StringFieldUpdateOperationsInput, {nullable:true})
email?: StringFieldUpdateOperationsInput; email?: StringFieldUpdateOperationsInput;

View File

@ -1,8 +1,8 @@
import { Field } from '@nestjs/graphql'; import { Field } from '@nestjs/graphql';
import { InputType } from '@nestjs/graphql'; import { InputType } from '@nestjs/graphql';
import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input'; import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input';
import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input';
import { BoolFieldUpdateOperationsInput } from '../prisma/bool-field-update-operations.input'; import { BoolFieldUpdateOperationsInput } from '../prisma/bool-field-update-operations.input';
import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input';
import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input'; import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input';
import { HideField } from '@nestjs/graphql'; import { HideField } from '@nestjs/graphql';
import { GraphQLJSON } from 'graphql-type-json'; import { GraphQLJSON } from 'graphql-type-json';
@ -24,9 +24,6 @@ export class UserUpdateWithoutCommentsInput {
@Field(() => StringFieldUpdateOperationsInput, {nullable:true}) @Field(() => StringFieldUpdateOperationsInput, {nullable:true})
lastName?: StringFieldUpdateOperationsInput; lastName?: StringFieldUpdateOperationsInput;
@Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true})
displayName?: NullableStringFieldUpdateOperationsInput;
@Field(() => StringFieldUpdateOperationsInput, {nullable:true}) @Field(() => StringFieldUpdateOperationsInput, {nullable:true})
email?: StringFieldUpdateOperationsInput; email?: StringFieldUpdateOperationsInput;

View File

@ -1,8 +1,8 @@
import { Field } from '@nestjs/graphql'; import { Field } from '@nestjs/graphql';
import { InputType } from '@nestjs/graphql'; import { InputType } from '@nestjs/graphql';
import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input'; import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input';
import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input';
import { BoolFieldUpdateOperationsInput } from '../prisma/bool-field-update-operations.input'; import { BoolFieldUpdateOperationsInput } from '../prisma/bool-field-update-operations.input';
import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input';
import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input'; import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input';
import { HideField } from '@nestjs/graphql'; import { HideField } from '@nestjs/graphql';
import { GraphQLJSON } from 'graphql-type-json'; import { GraphQLJSON } from 'graphql-type-json';
@ -24,9 +24,6 @@ export class UserUpdateWithoutCompaniesInput {
@Field(() => StringFieldUpdateOperationsInput, {nullable:true}) @Field(() => StringFieldUpdateOperationsInput, {nullable:true})
lastName?: StringFieldUpdateOperationsInput; lastName?: StringFieldUpdateOperationsInput;
@Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true})
displayName?: NullableStringFieldUpdateOperationsInput;
@Field(() => StringFieldUpdateOperationsInput, {nullable:true}) @Field(() => StringFieldUpdateOperationsInput, {nullable:true})
email?: StringFieldUpdateOperationsInput; email?: StringFieldUpdateOperationsInput;

View File

@ -1,8 +1,8 @@
import { Field } from '@nestjs/graphql'; import { Field } from '@nestjs/graphql';
import { InputType } from '@nestjs/graphql'; import { InputType } from '@nestjs/graphql';
import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input'; import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input';
import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input';
import { BoolFieldUpdateOperationsInput } from '../prisma/bool-field-update-operations.input'; import { BoolFieldUpdateOperationsInput } from '../prisma/bool-field-update-operations.input';
import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input';
import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input'; import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input';
import { HideField } from '@nestjs/graphql'; import { HideField } from '@nestjs/graphql';
import { GraphQLJSON } from 'graphql-type-json'; import { GraphQLJSON } from 'graphql-type-json';
@ -24,9 +24,6 @@ export class UserUpdateWithoutRefreshTokensInput {
@Field(() => StringFieldUpdateOperationsInput, {nullable:true}) @Field(() => StringFieldUpdateOperationsInput, {nullable:true})
lastName?: StringFieldUpdateOperationsInput; lastName?: StringFieldUpdateOperationsInput;
@Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true})
displayName?: NullableStringFieldUpdateOperationsInput;
@Field(() => StringFieldUpdateOperationsInput, {nullable:true}) @Field(() => StringFieldUpdateOperationsInput, {nullable:true})
email?: StringFieldUpdateOperationsInput; email?: StringFieldUpdateOperationsInput;

View File

@ -1,8 +1,8 @@
import { Field } from '@nestjs/graphql'; import { Field } from '@nestjs/graphql';
import { InputType } from '@nestjs/graphql'; import { InputType } from '@nestjs/graphql';
import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input'; import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input';
import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input';
import { BoolFieldUpdateOperationsInput } from '../prisma/bool-field-update-operations.input'; import { BoolFieldUpdateOperationsInput } from '../prisma/bool-field-update-operations.input';
import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input';
import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input'; import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input';
import { HideField } from '@nestjs/graphql'; import { HideField } from '@nestjs/graphql';
import { GraphQLJSON } from 'graphql-type-json'; import { GraphQLJSON } from 'graphql-type-json';
@ -24,9 +24,6 @@ export class UserUpdateWithoutWorkspaceMemberInput {
@Field(() => StringFieldUpdateOperationsInput, {nullable:true}) @Field(() => StringFieldUpdateOperationsInput, {nullable:true})
lastName?: StringFieldUpdateOperationsInput; lastName?: StringFieldUpdateOperationsInput;
@Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true})
displayName?: NullableStringFieldUpdateOperationsInput;
@Field(() => StringFieldUpdateOperationsInput, {nullable:true}) @Field(() => StringFieldUpdateOperationsInput, {nullable:true})
email?: StringFieldUpdateOperationsInput; email?: StringFieldUpdateOperationsInput;

View File

@ -1,8 +1,8 @@
import { Field } from '@nestjs/graphql'; import { Field } from '@nestjs/graphql';
import { InputType } from '@nestjs/graphql'; import { InputType } from '@nestjs/graphql';
import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input'; import { StringFieldUpdateOperationsInput } from '../prisma/string-field-update-operations.input';
import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input';
import { BoolFieldUpdateOperationsInput } from '../prisma/bool-field-update-operations.input'; import { BoolFieldUpdateOperationsInput } from '../prisma/bool-field-update-operations.input';
import { NullableStringFieldUpdateOperationsInput } from '../prisma/nullable-string-field-update-operations.input';
import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input'; import { NullableDateTimeFieldUpdateOperationsInput } from '../prisma/nullable-date-time-field-update-operations.input';
import { HideField } from '@nestjs/graphql'; import { HideField } from '@nestjs/graphql';
import { GraphQLJSON } from 'graphql-type-json'; import { GraphQLJSON } from 'graphql-type-json';
@ -25,9 +25,6 @@ export class UserUpdateInput {
@Field(() => StringFieldUpdateOperationsInput, {nullable:true}) @Field(() => StringFieldUpdateOperationsInput, {nullable:true})
lastName?: StringFieldUpdateOperationsInput; lastName?: StringFieldUpdateOperationsInput;
@Field(() => NullableStringFieldUpdateOperationsInput, {nullable:true})
displayName?: NullableStringFieldUpdateOperationsInput;
@Field(() => StringFieldUpdateOperationsInput, {nullable:true}) @Field(() => StringFieldUpdateOperationsInput, {nullable:true})
email?: StringFieldUpdateOperationsInput; email?: StringFieldUpdateOperationsInput;

View File

@ -1,8 +1,8 @@
import { Field } from '@nestjs/graphql'; import { Field } from '@nestjs/graphql';
import { InputType } from '@nestjs/graphql'; import { InputType } from '@nestjs/graphql';
import { StringFilter } from '../prisma/string-filter.input'; import { StringFilter } from '../prisma/string-filter.input';
import { StringNullableFilter } from '../prisma/string-nullable-filter.input';
import { BoolFilter } from '../prisma/bool-filter.input'; import { BoolFilter } from '../prisma/bool-filter.input';
import { StringNullableFilter } from '../prisma/string-nullable-filter.input';
import { DateTimeNullableFilter } from '../prisma/date-time-nullable-filter.input'; import { DateTimeNullableFilter } from '../prisma/date-time-nullable-filter.input';
import { HideField } from '@nestjs/graphql'; import { HideField } from '@nestjs/graphql';
import { JsonNullableFilter } from '../prisma/json-nullable-filter.input'; import { JsonNullableFilter } from '../prisma/json-nullable-filter.input';
@ -33,9 +33,6 @@ export class UserWhereInput {
@Field(() => StringFilter, {nullable:true}) @Field(() => StringFilter, {nullable:true})
lastName?: StringFilter; lastName?: StringFilter;
@Field(() => StringNullableFilter, {nullable:true})
displayName?: StringNullableFilter;
@Field(() => StringFilter, {nullable:true}) @Field(() => StringFilter, {nullable:true})
email?: StringFilter; email?: StringFilter;

View File

@ -21,9 +21,6 @@ export class User {
@Field(() => String, {nullable:false}) @Field(() => String, {nullable:false})
lastName!: string; lastName!: string;
@HideField()
displayName!: string | null;
@Field(() => String, {nullable:false}) @Field(() => String, {nullable:false})
email!: string; email!: string;

View File

@ -9,8 +9,8 @@ export class CreateManyWorkspaceMemberArgs {
@Field(() => [WorkspaceMemberCreateManyInput], {nullable:false}) @Field(() => [WorkspaceMemberCreateManyInput], {nullable:false})
@Type(() => WorkspaceMemberCreateManyInput) @Type(() => WorkspaceMemberCreateManyInput)
@ValidateNested({each: true})
@Type(() => WorkspaceMemberCreateManyInput) @Type(() => WorkspaceMemberCreateManyInput)
@ValidateNested({each: true})
data!: Array<WorkspaceMemberCreateManyInput>; data!: Array<WorkspaceMemberCreateManyInput>;
@Field(() => Boolean, {nullable:true}) @Field(() => Boolean, {nullable:true})

View File

@ -9,7 +9,7 @@ export class CreateOneWorkspaceMemberArgs {
@Field(() => WorkspaceMemberCreateInput, {nullable:false}) @Field(() => WorkspaceMemberCreateInput, {nullable:false})
@Type(() => WorkspaceMemberCreateInput) @Type(() => WorkspaceMemberCreateInput)
@ValidateNested({each: true})
@Type(() => WorkspaceMemberCreateInput) @Type(() => WorkspaceMemberCreateInput)
@ValidateNested({each: true})
data!: WorkspaceMemberCreateInput; data!: WorkspaceMemberCreateInput;
} }

View File

@ -10,8 +10,8 @@ export class UpdateManyWorkspaceMemberArgs {
@Field(() => WorkspaceMemberUpdateManyMutationInput, {nullable:false}) @Field(() => WorkspaceMemberUpdateManyMutationInput, {nullable:false})
@Type(() => WorkspaceMemberUpdateManyMutationInput) @Type(() => WorkspaceMemberUpdateManyMutationInput)
@ValidateNested({each: true})
@Type(() => WorkspaceMemberUpdateManyMutationInput) @Type(() => WorkspaceMemberUpdateManyMutationInput)
@ValidateNested({each: true})
data!: WorkspaceMemberUpdateManyMutationInput; data!: WorkspaceMemberUpdateManyMutationInput;
@Field(() => WorkspaceMemberWhereInput, {nullable:true}) @Field(() => WorkspaceMemberWhereInput, {nullable:true})

View File

@ -10,8 +10,8 @@ export class UpdateOneWorkspaceMemberArgs {
@Field(() => WorkspaceMemberUpdateInput, {nullable:false}) @Field(() => WorkspaceMemberUpdateInput, {nullable:false})
@Type(() => WorkspaceMemberUpdateInput) @Type(() => WorkspaceMemberUpdateInput)
@ValidateNested({each: true})
@Type(() => WorkspaceMemberUpdateInput) @Type(() => WorkspaceMemberUpdateInput)
@ValidateNested({each: true})
data!: WorkspaceMemberUpdateInput; data!: WorkspaceMemberUpdateInput;
@Field(() => WorkspaceMemberWhereUniqueInput, {nullable:false}) @Field(() => WorkspaceMemberWhereUniqueInput, {nullable:false})

View File

@ -9,8 +9,8 @@ export class CreateManyWorkspaceArgs {
@Field(() => [WorkspaceCreateManyInput], {nullable:false}) @Field(() => [WorkspaceCreateManyInput], {nullable:false})
@Type(() => WorkspaceCreateManyInput) @Type(() => WorkspaceCreateManyInput)
@ValidateNested({each: true})
@Type(() => WorkspaceCreateManyInput) @Type(() => WorkspaceCreateManyInput)
@ValidateNested({each: true})
data!: Array<WorkspaceCreateManyInput>; data!: Array<WorkspaceCreateManyInput>;
@Field(() => Boolean, {nullable:true}) @Field(() => Boolean, {nullable:true})

View File

@ -9,7 +9,7 @@ export class CreateOneWorkspaceArgs {
@Field(() => WorkspaceCreateInput, {nullable:false}) @Field(() => WorkspaceCreateInput, {nullable:false})
@Type(() => WorkspaceCreateInput) @Type(() => WorkspaceCreateInput)
@ValidateNested({each: true})
@Type(() => WorkspaceCreateInput) @Type(() => WorkspaceCreateInput)
@ValidateNested({each: true})
data!: WorkspaceCreateInput; data!: WorkspaceCreateInput;
} }

View File

@ -10,8 +10,8 @@ export class UpdateManyWorkspaceArgs {
@Field(() => WorkspaceUpdateManyMutationInput, {nullable:false}) @Field(() => WorkspaceUpdateManyMutationInput, {nullable:false})
@Type(() => WorkspaceUpdateManyMutationInput) @Type(() => WorkspaceUpdateManyMutationInput)
@ValidateNested({each: true})
@Type(() => WorkspaceUpdateManyMutationInput) @Type(() => WorkspaceUpdateManyMutationInput)
@ValidateNested({each: true})
data!: WorkspaceUpdateManyMutationInput; data!: WorkspaceUpdateManyMutationInput;
@Field(() => WorkspaceWhereInput, {nullable:true}) @Field(() => WorkspaceWhereInput, {nullable:true})

View File

@ -10,8 +10,8 @@ export class UpdateOneWorkspaceArgs {
@Field(() => WorkspaceUpdateInput, {nullable:false}) @Field(() => WorkspaceUpdateInput, {nullable:false})
@Type(() => WorkspaceUpdateInput) @Type(() => WorkspaceUpdateInput)
@ValidateNested({each: true})
@Type(() => WorkspaceUpdateInput) @Type(() => WorkspaceUpdateInput)
@ValidateNested({each: true})
data!: WorkspaceUpdateInput; data!: WorkspaceUpdateInput;
@Field(() => WorkspaceWhereUniqueInput, {nullable:false}) @Field(() => WorkspaceWhereUniqueInput, {nullable:false})

View File

@ -8,6 +8,11 @@ import { VerifyInput } from './dto/verify.input';
import { AuthService } from './services/auth.service'; import { AuthService } from './services/auth.service';
import { LoginToken } from './dto/login-token.entity'; import { LoginToken } from './dto/login-token.entity';
import { ChallengeInput } from './dto/challenge.input'; import { ChallengeInput } from './dto/challenge.input';
import {
PrismaSelect,
PrismaSelector,
} from 'src/decorators/prisma-select.decorator';
import { Prisma } from '@prisma/client';
@Resolver() @Resolver()
export class AuthResolver { export class AuthResolver {
@ -25,11 +30,21 @@ export class AuthResolver {
} }
@Mutation(() => Verify) @Mutation(() => Verify)
async verify(@Args() verifyInput: VerifyInput): Promise<Verify> { async verify(
@Args() verifyInput: VerifyInput,
@PrismaSelector({
modelName: 'User',
defaultFields: { User: { id: true } },
})
prismaSelect: PrismaSelect<'User'>,
): Promise<Verify> {
const email = await this.tokenService.verifyLoginToken( const email = await this.tokenService.verifyLoginToken(
verifyInput.loginToken, verifyInput.loginToken,
); );
const result = await this.authService.verify(email); const select = prismaSelect.valueOf('user') as Prisma.UserSelect & {
id: true;
};
const result = await this.authService.verify(email, select);
return result; return result;
} }

View File

@ -16,7 +16,13 @@ export class VerifyAuthController {
const email = await this.tokenService.verifyLoginToken( const email = await this.tokenService.verifyLoginToken(
verifyInput.loginToken, verifyInput.loginToken,
); );
const result = await this.authService.verify(email); const result = await this.authService.verify(email, {
id: true,
firstName: true,
lastName: true,
email: true,
emailVerified: true,
});
return result; return result;
} }

View File

@ -5,5 +5,5 @@ import { User } from 'src/core/@generated/user/user.model';
@ObjectType() @ObjectType()
export class Verify extends AuthTokens { export class Verify extends AuthTokens {
@Field(() => User) @Field(() => User)
user: User; user: Partial<User>;
} }

View File

@ -11,6 +11,7 @@ import { RegisterInput } from '../dto/register.input';
import { PASSWORD_REGEX, compareHash, hashPassword } from '../auth.util'; import { PASSWORD_REGEX, compareHash, hashPassword } from '../auth.util';
import { Verify } from '../dto/verify.entity'; import { Verify } from '../dto/verify.entity';
import { TokenService } from './token.service'; import { TokenService } from './token.service';
import { Prisma } from '@prisma/client';
export type UserPayload = { export type UserPayload = {
firstName: string; firstName: string;
@ -74,11 +75,17 @@ export class AuthService {
return user; return user;
} }
async verify(email: string): Promise<Verify> { async verify(
email: string,
select: Prisma.UserSelect & {
id: true;
},
): Promise<Verify> {
const user = await this.userService.findUnique({ const user = await this.userService.findUnique({
where: { where: {
email, email,
}, },
select,
}); });
assert(user, "This user doesn't exist", NotFoundException); assert(user, "This user doesn't exist", NotFoundException);

View File

@ -1,8 +1,6 @@
import { Args, Resolver, Query, ResolveField, Parent } from '@nestjs/graphql'; import { Args, Resolver, Query, ResolveField, Parent } from '@nestjs/graphql';
import { UserService } from './user.service'; import { UserService } from './user.service';
import { FindManyUserArgs } from 'src/core/@generated/user/find-many-user.args'; import { FindManyUserArgs } from 'src/core/@generated/user/find-many-user.args';
import { Workspace } from '@prisma/client';
import { AuthWorkspace } from 'src/decorators/auth-workspace.decorator';
import { User } from 'src/core/@generated/user/user.model'; import { User } from 'src/core/@generated/user/user.model';
import { ExceptionFilter } from 'src/filters/exception.filter'; import { ExceptionFilter } from 'src/filters/exception.filter';
import { UseFilters, UseGuards } from '@nestjs/common'; import { UseFilters, UseGuards } from '@nestjs/common';
@ -31,7 +29,6 @@ export class UserResolver {
@CheckAbilities(ReadUserAbilityHandler) @CheckAbilities(ReadUserAbilityHandler)
async findManyUser( async findManyUser(
@Args() args: FindManyUserArgs, @Args() args: FindManyUserArgs,
@AuthWorkspace() workspace: Workspace,
@UserAbility() ability: AppAbility, @UserAbility() ability: AppAbility,
@PrismaSelector({ modelName: 'User' }) @PrismaSelector({ modelName: 'User' })
prismaSelect: PrismaSelect<'User'>, prismaSelect: PrismaSelect<'User'>,
@ -51,11 +48,6 @@ export class UserResolver {
nullable: false, nullable: false,
}) })
displayName(@Parent() parent: User): string { displayName(@Parent() parent: User): string {
// TODO: Should be removed when displayName is removed from the database return `${parent.firstName ?? ''} ${parent.lastName ?? ''}`;
if (!parent.firstName && !parent.lastName) {
return parent.displayName ?? '';
}
return `${parent.firstName} ${parent.lastName}`;
} }
} }

View File

@ -0,0 +1,10 @@
/*
Warnings:
- You are about to drop the column `displayName` on the `users` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "users" DROP COLUMN "displayName",
ALTER COLUMN "firstName" DROP DEFAULT,
ALTER COLUMN "lastName" DROP DEFAULT;

View File

@ -138,11 +138,6 @@ model User {
firstName String firstName String
/// @Validator.IsString() /// @Validator.IsString()
lastName String lastName String
// @deprecated: Use `firstName` and `lastName` instead
/// @Validator.IsString()
/// @Validator.IsOptional()
/// @TypeGraphQL.omit(input: false, output: true)
displayName String?
/// @Validator.IsEmail() /// @Validator.IsEmail()
email String @unique email String @unique
/// @Validator.IsBoolean() /// @Validator.IsBoolean()

View File

@ -1,5 +1,6 @@
import { createParamDecorator, ExecutionContext } from '@nestjs/common'; import { createParamDecorator, ExecutionContext } from '@nestjs/common';
import { GqlExecutionContext } from '@nestjs/graphql'; import { GqlExecutionContext } from '@nestjs/graphql';
import merge from 'lodash.merge';
import { import {
PrismaSelect, PrismaSelect,
ModelSelectMap, ModelSelectMap,
@ -8,6 +9,14 @@ import {
export { PrismaSelect }; export { PrismaSelect };
const globalDefaultFields: DefaultFieldsMap = {
User: {
// Needed for displayName resolve field
firstName: true,
lastName: true,
},
};
export const PrismaSelector = createParamDecorator( export const PrismaSelector = createParamDecorator(
( (
data: { data: {
@ -20,7 +29,7 @@ export const PrismaSelector = createParamDecorator(
const info = gqlCtx.getInfo(); const info = gqlCtx.getInfo();
return new PrismaSelect(data.modelName, info, { return new PrismaSelect(data.modelName, info, {
defaultFields: data.defaultFields, defaultFields: merge(globalDefaultFields, data.defaultFields),
}); });
}, },
); );

View File

@ -44,9 +44,9 @@ export class PrismaSelect<
mergeObject?: any, mergeObject?: any,
) { ) {
if (typeof filterByOrMergeObject === 'string') { if (typeof filterByOrMergeObject === 'string') {
return super.valueOf(field, filterByOrMergeObject, mergeObject); return super.valueOf(field, filterByOrMergeObject, mergeObject).select;
} else { } else {
return super.valueOf(field, this.modelName, filterByOrMergeObject); return super.valueOf(field, this.modelName, filterByOrMergeObject).select;
} }
} }

View File

@ -2872,6 +2872,13 @@
dependencies: dependencies:
"@types/lodash" "*" "@types/lodash" "*"
"@types/lodash.merge@^4.6.7":
version "4.6.7"
resolved "https://registry.yarnpkg.com/@types/lodash.merge/-/lodash.merge-4.6.7.tgz#0af6555dd8bc6568ef73e5e0d820a027362946b1"
integrity sha512-OwxUJ9E50gw3LnAefSHJPHaBLGEKmQBQ7CZe/xflHkyy/wH2zVyEIAKReHvVrrn7zKdF58p16We9kMfh7v0RRQ==
dependencies:
"@types/lodash" "*"
"@types/lodash@*": "@types/lodash@*":
version "4.14.195" version "4.14.195"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.195.tgz#bafc975b252eb6cea78882ce8a7b6bf22a6de632" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.195.tgz#bafc975b252eb6cea78882ce8a7b6bf22a6de632"
@ -6238,7 +6245,7 @@ lodash.memoize@4.x:
lodash.merge@^4.6.2: lodash.merge@^4.6.2:
version "4.6.2" version "4.6.2"
resolved "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a"
integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==
lodash.omit@4.5.0: lodash.omit@4.5.0: