From 21218858d45b9f847484e33ef07d70ed5568edd6 Mon Sep 17 00:00:00 2001 From: roman Date: Sun, 23 Aug 2020 16:54:16 +0400 Subject: [PATCH] fix: Detection property nullable type --- ...rticle-create-many-without-author.input.ts | 4 +- ...-create-many-without-favorited-by.input.ts | 4 +- .../article-create-many-without-tags.input.ts | 4 +- ...ticle-create-one-without-comments.input.ts | 4 +- .../article-create-without-author.input.ts | 16 ++-- .../article-create-without-comments.input.ts | 18 ++-- ...ticle-create-without-favorited-by.input.ts | 18 ++-- .../article-create-without-tags.input.ts | 18 ++-- .../article/article-create.input.ts | 18 ++-- .../article/article-filter.input.ts | 6 +- .../article-list-relation-filter.input.ts | 6 +- .../article/article-order-by.input.ts | 18 ++-- .../article/article-scalar-where.input.ts | 24 ++--- .../article/article-update-many-data.input.ts | 16 ++-- .../article-update-many-mutation.input.ts | 16 ++-- ...cle-update-many-with-where-nested.input.ts | 4 +- ...rticle-update-many-without-author.input.ts | 27 ++---- ...-update-many-without-favorited-by.input.ts | 27 ++---- .../article-update-many-without-tags.input.ts | 27 ++---- ...ticle-update-one-without-comments.input.ts | 12 +-- ...-with-where-unique-without-author.input.ts | 4 +- ...where-unique-without-favorited-by.input.ts | 4 +- ...te-with-where-unique-without-tags.input.ts | 4 +- ...rticle-update-without-author-data.input.ts | 16 ++-- ...icle-update-without-comments-data.input.ts | 18 ++-- ...-update-without-favorited-by-data.input.ts | 18 ++-- .../article-update-without-tags-data.input.ts | 18 ++-- .../article/article-update.input.ts | 18 ++-- ...-with-where-unique-without-author.input.ts | 6 +- ...where-unique-without-favorited-by.input.ts | 6 +- ...rt-with-where-unique-without-tags.input.ts | 6 +- .../article-upsert-without-comments.input.ts | 4 +- .../article/article-where-unique.input.ts | 4 +- src/@generated/article/article-where.input.ts | 26 ++--- src/@generated/article/article.model.ts | 4 +- ...mment-create-many-without-article.input.ts | 4 +- ...omment-create-many-without-author.input.ts | 4 +- .../comment-create-without-article.input.ts | 10 +- .../comment-create-without-author.input.ts | 8 +- .../comment/comment-create.input.ts | 10 +- .../comment/comment-filter.input.ts | 6 +- .../comment-list-relation-filter.input.ts | 6 +- .../comment/comment-order-by.input.ts | 10 +- .../comment/comment-scalar-where.input.ts | 16 ++-- .../comment/comment-update-many-data.input.ts | 8 +- .../comment-update-many-mutation.input.ts | 8 +- ...ent-update-many-with-where-nested.input.ts | 4 +- ...mment-update-many-without-article.input.ts | 27 ++---- ...omment-update-many-without-author.input.ts | 27 ++---- ...with-where-unique-without-article.input.ts | 4 +- ...-with-where-unique-without-author.input.ts | 4 +- ...mment-update-without-article-data.input.ts | 10 +- ...omment-update-without-author-data.input.ts | 8 +- .../comment/comment-update.input.ts | 10 +- ...with-where-unique-without-article.input.ts | 6 +- ...-with-where-unique-without-author.input.ts | 6 +- .../comment/comment-where-unique.input.ts | 2 +- src/@generated/comment/comment-where.input.ts | 20 ++-- src/@generated/comment/comment.model.ts | 4 +- .../prisma/date-time-filter.input.ts | 16 ++-- src/@generated/prisma/int-filter.input.ts | 16 ++-- .../prisma/int-nullable-filter.input.ts | 2 +- .../prisma/nested-date-time-filter.input.ts | 12 +-- .../prisma/nested-int-filter.input.ts | 12 +-- .../nested-int-nullable-filter.input.ts | 2 +- .../prisma/nested-string-filter.input.ts | 18 ++-- .../nested-string-nullable-filter.input.ts | 2 +- .../prisma/nullable-int-filter.input.ts | 4 +- .../prisma/nullable-string-filter.input.ts | 4 +- src/@generated/prisma/string-filter.input.ts | 22 ++--- .../prisma/string-nullable-filter.input.ts | 2 +- .../tag-create-many-without-articles.input.ts | 4 +- .../tag/tag-create-without-articles.input.ts | 4 +- src/@generated/tag/tag-create.input.ts | 4 +- src/@generated/tag/tag-filter.input.ts | 6 +- .../tag/tag-list-relation-filter.input.ts | 6 +- src/@generated/tag/tag-order-by.input.ts | 4 +- src/@generated/tag/tag-scalar-where.input.ts | 10 +- .../tag/tag-update-many-data.input.ts | 4 +- .../tag/tag-update-many-mutation.input.ts | 4 +- ...tag-update-many-with-where-nested.input.ts | 4 +- .../tag-update-many-without-articles.input.ts | 24 ++--- ...ith-where-unique-without-articles.input.ts | 4 +- .../tag-update-without-articles-data.input.ts | 4 +- src/@generated/tag/tag-update.input.ts | 4 +- ...ith-where-unique-without-articles.input.ts | 6 +- src/@generated/tag/tag-where-unique.input.ts | 4 +- src/@generated/tag/tag-where.input.ts | 10 +- ...te-many-without-favorite-articles.input.ts | 7 +- ...ser-create-many-without-followers.input.ts | 4 +- ...ser-create-many-without-following.input.ts | 4 +- .../user-create-one-without-articles.input.ts | 4 +- .../user-create-one-without-comments.input.ts | 4 +- .../user-create-without-articles.input.ts | 8 +- .../user-create-without-comments.input.ts | 8 +- ...-create-without-favorite-articles.input.ts | 8 +- .../user-create-without-followers.input.ts | 8 +- .../user-create-without-following.input.ts | 8 +- src/@generated/user/user-create.input.ts | 8 +- src/@generated/user/user-filter.input.ts | 6 +- .../user/user-list-relation-filter.input.ts | 6 +- src/@generated/user/user-order-by.input.ts | 8 +- .../user/user-scalar-where.input.ts | 14 +-- .../user/user-update-many-data.input.ts | 8 +- .../user/user-update-many-mutation.input.ts | 8 +- ...ser-update-many-with-where-nested.input.ts | 4 +- ...te-many-without-favorite-articles.input.ts | 27 ++---- ...ser-update-many-without-followers.input.ts | 24 ++--- ...ser-update-many-without-following.input.ts | 24 ++--- ...ate-one-required-without-articles.input.ts | 8 +- ...ate-one-required-without-comments.input.ts | 8 +- ...-unique-without-favorite-articles.input.ts | 4 +- ...th-where-unique-without-followers.input.ts | 4 +- ...th-where-unique-without-following.input.ts | 4 +- ...user-update-without-articles-data.input.ts | 8 +- ...user-update-without-comments-data.input.ts | 8 +- ...te-without-favorite-articles-data.input.ts | 8 +- ...ser-update-without-followers-data.input.ts | 8 +- ...ser-update-without-following-data.input.ts | 8 +- src/@generated/user/user-update.input.ts | 8 +- ...-unique-without-favorite-articles.input.ts | 6 +- ...th-where-unique-without-followers.input.ts | 6 +- ...th-where-unique-without-following.input.ts | 6 +- .../user-upsert-without-articles.input.ts | 4 +- .../user-upsert-without-comments.input.ts | 4 +- .../user/user-where-unique.input.ts | 6 +- src/@generated/user/user-where.input.ts | 14 +-- src/generate-file-name.ts | 29 ++++-- src/generate-input.spec.ts | 94 ++++++++++++++++--- src/generate-input.ts | 58 ++++++++---- src/generate-model.spec.ts | 14 ++- src/generate-model.ts | 20 ++-- src/generate.ts | 9 +- src/testing/type-tests.ts | 52 ++++++++-- src/type-utils.ts | 23 +---- 135 files changed, 781 insertions(+), 723 deletions(-) diff --git a/src/@generated/article/article-create-many-without-author.input.ts b/src/@generated/article/article-create-many-without-author.input.ts index 5693e1d6..a1b982cf 100644 --- a/src/@generated/article/article-create-many-without-author.input.ts +++ b/src/@generated/article/article-create-many-without-author.input.ts @@ -9,11 +9,11 @@ export class ArticleCreateManyWithoutAuthorInput { nullable: true, description: undefined, }) - create?: ArticleCreateWithoutAuthorInput | ArticleCreateWithoutAuthorInput[] | null; + create?: Array; @Field(() => [ArticleWhereUniqueInput], { nullable: true, description: undefined, }) - connect?: ArticleWhereUniqueInput | ArticleWhereUniqueInput[] | null; + connect?: Array; } diff --git a/src/@generated/article/article-create-many-without-favorited-by.input.ts b/src/@generated/article/article-create-many-without-favorited-by.input.ts index 74c4b567..a0790cc3 100644 --- a/src/@generated/article/article-create-many-without-favorited-by.input.ts +++ b/src/@generated/article/article-create-many-without-favorited-by.input.ts @@ -9,11 +9,11 @@ export class ArticleCreateManyWithoutFavoritedByInput { nullable: true, description: undefined, }) - create?: ArticleCreateWithoutFavoritedByInput | ArticleCreateWithoutFavoritedByInput[] | null; + create?: Array; @Field(() => [ArticleWhereUniqueInput], { nullable: true, description: undefined, }) - connect?: ArticleWhereUniqueInput | ArticleWhereUniqueInput[] | null; + connect?: Array; } diff --git a/src/@generated/article/article-create-many-without-tags.input.ts b/src/@generated/article/article-create-many-without-tags.input.ts index 52ee110d..d58e7430 100644 --- a/src/@generated/article/article-create-many-without-tags.input.ts +++ b/src/@generated/article/article-create-many-without-tags.input.ts @@ -9,11 +9,11 @@ export class ArticleCreateManyWithoutTagsInput { nullable: true, description: undefined, }) - create?: ArticleCreateWithoutTagsInput | ArticleCreateWithoutTagsInput[] | null; + create?: Array; @Field(() => [ArticleWhereUniqueInput], { nullable: true, description: undefined, }) - connect?: ArticleWhereUniqueInput | ArticleWhereUniqueInput[] | null; + connect?: Array; } diff --git a/src/@generated/article/article-create-one-without-comments.input.ts b/src/@generated/article/article-create-one-without-comments.input.ts index 8138739e..63399fe4 100644 --- a/src/@generated/article/article-create-one-without-comments.input.ts +++ b/src/@generated/article/article-create-one-without-comments.input.ts @@ -9,11 +9,11 @@ export class ArticleCreateOneWithoutCommentsInput { nullable: true, description: undefined, }) - create?: ArticleCreateWithoutCommentsInput | null; + create?: ArticleCreateWithoutCommentsInput; @Field(() => ArticleWhereUniqueInput, { nullable: true, description: undefined, }) - connect?: ArticleWhereUniqueInput | null; + connect?: ArticleWhereUniqueInput; } diff --git a/src/@generated/article/article-create-without-author.input.ts b/src/@generated/article/article-create-without-author.input.ts index 05943f28..de2b2157 100644 --- a/src/@generated/article/article-create-without-author.input.ts +++ b/src/@generated/article/article-create-without-author.input.ts @@ -10,49 +10,49 @@ export class ArticleCreateWithoutAuthorInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - slug?: string | null; + slug?: string; @Field(() => String, { nullable: true, description: undefined, }) - title?: string | null; + title?: string; @Field(() => String, { nullable: true, description: undefined, }) - description?: string | null; + description?: string; @Field(() => String, { nullable: true, description: undefined, }) - body?: string | null; + body?: string; @Field(() => String, { nullable: true, description: undefined, }) - createdAt?: string | null; + createdAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - updatedAt?: string | null; + updatedAt?: Date | string; @Field(() => Int, { nullable: true, description: undefined, }) - favoritesCount?: number | null; + favoritesCount?: number; @Field(() => Boolean, { nullable: true, diff --git a/src/@generated/article/article-create-without-comments.input.ts b/src/@generated/article/article-create-without-comments.input.ts index 2e95db9c..f5f475e8 100644 --- a/src/@generated/article/article-create-without-comments.input.ts +++ b/src/@generated/article/article-create-without-comments.input.ts @@ -10,49 +10,49 @@ export class ArticleCreateWithoutCommentsInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - slug?: string | null; + slug?: string; @Field(() => String, { nullable: true, description: undefined, }) - title?: string | null; + title?: string; @Field(() => String, { nullable: true, description: undefined, }) - description?: string | null; + description?: string; @Field(() => String, { nullable: true, description: undefined, }) - body?: string | null; + body?: string; @Field(() => String, { nullable: true, description: undefined, }) - createdAt?: string | null; + createdAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - updatedAt?: string | null; + updatedAt?: Date | string; @Field(() => Int, { nullable: true, description: undefined, }) - favoritesCount?: number | null; + favoritesCount?: number; @Field(() => Boolean, { nullable: true, @@ -70,7 +70,7 @@ export class ArticleCreateWithoutCommentsInput { nullable: true, description: undefined, }) - author?: UserCreateOneWithoutArticlesInput | null; + author?: UserCreateOneWithoutArticlesInput; @Field(() => UserCreateManyWithoutFavoriteArticlesInput, { nullable: true, diff --git a/src/@generated/article/article-create-without-favorited-by.input.ts b/src/@generated/article/article-create-without-favorited-by.input.ts index e6c48f87..d01ce59d 100644 --- a/src/@generated/article/article-create-without-favorited-by.input.ts +++ b/src/@generated/article/article-create-without-favorited-by.input.ts @@ -10,49 +10,49 @@ export class ArticleCreateWithoutFavoritedByInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - slug?: string | null; + slug?: string; @Field(() => String, { nullable: true, description: undefined, }) - title?: string | null; + title?: string; @Field(() => String, { nullable: true, description: undefined, }) - description?: string | null; + description?: string; @Field(() => String, { nullable: true, description: undefined, }) - body?: string | null; + body?: string; @Field(() => String, { nullable: true, description: undefined, }) - createdAt?: string | null; + createdAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - updatedAt?: string | null; + updatedAt?: Date | string; @Field(() => Int, { nullable: true, description: undefined, }) - favoritesCount?: number | null; + favoritesCount?: number; @Field(() => Boolean, { nullable: true, @@ -70,7 +70,7 @@ export class ArticleCreateWithoutFavoritedByInput { nullable: true, description: undefined, }) - author?: UserCreateOneWithoutArticlesInput | null; + author?: UserCreateOneWithoutArticlesInput; @Field(() => CommentCreateManyWithoutArticleInput, { nullable: true, diff --git a/src/@generated/article/article-create-without-tags.input.ts b/src/@generated/article/article-create-without-tags.input.ts index a7f66300..8a2f7b45 100644 --- a/src/@generated/article/article-create-without-tags.input.ts +++ b/src/@generated/article/article-create-without-tags.input.ts @@ -10,49 +10,49 @@ export class ArticleCreateWithoutTagsInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - slug?: string | null; + slug?: string; @Field(() => String, { nullable: true, description: undefined, }) - title?: string | null; + title?: string; @Field(() => String, { nullable: true, description: undefined, }) - description?: string | null; + description?: string; @Field(() => String, { nullable: true, description: undefined, }) - body?: string | null; + body?: string; @Field(() => String, { nullable: true, description: undefined, }) - createdAt?: string | null; + createdAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - updatedAt?: string | null; + updatedAt?: Date | string; @Field(() => Int, { nullable: true, description: undefined, }) - favoritesCount?: number | null; + favoritesCount?: number; @Field(() => Boolean, { nullable: true, @@ -64,7 +64,7 @@ export class ArticleCreateWithoutTagsInput { nullable: true, description: undefined, }) - author?: UserCreateOneWithoutArticlesInput | null; + author?: UserCreateOneWithoutArticlesInput; @Field(() => UserCreateManyWithoutFavoriteArticlesInput, { nullable: true, diff --git a/src/@generated/article/article-create.input.ts b/src/@generated/article/article-create.input.ts index 2c101152..81e20c35 100644 --- a/src/@generated/article/article-create.input.ts +++ b/src/@generated/article/article-create.input.ts @@ -11,49 +11,49 @@ export class ArticleCreateInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - slug?: string | null; + slug?: string; @Field(() => String, { nullable: true, description: undefined, }) - title?: string | null; + title?: string; @Field(() => String, { nullable: true, description: undefined, }) - description?: string | null; + description?: string; @Field(() => String, { nullable: true, description: undefined, }) - body?: string | null; + body?: string; @Field(() => String, { nullable: true, description: undefined, }) - createdAt?: string | null; + createdAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - updatedAt?: string | null; + updatedAt?: Date | string; @Field(() => Int, { nullable: true, description: undefined, }) - favoritesCount?: number | null; + favoritesCount?: number; @Field(() => Boolean, { nullable: true, @@ -71,7 +71,7 @@ export class ArticleCreateInput { nullable: true, description: undefined, }) - author?: UserCreateOneWithoutArticlesInput | null; + author?: UserCreateOneWithoutArticlesInput; @Field(() => UserCreateManyWithoutFavoriteArticlesInput, { nullable: true, diff --git a/src/@generated/article/article-filter.input.ts b/src/@generated/article/article-filter.input.ts index 55a509e5..da6b8ef2 100644 --- a/src/@generated/article/article-filter.input.ts +++ b/src/@generated/article/article-filter.input.ts @@ -8,17 +8,17 @@ export class ArticleFilter { nullable: true, description: undefined, }) - every?: ArticleWhereInput | ArticleWhereInput[] | null; + every?: ArticleWhereInput; @Field(() => ArticleWhereInput, { nullable: true, description: undefined, }) - some?: ArticleWhereInput | ArticleWhereInput[] | null; + some?: ArticleWhereInput; @Field(() => ArticleWhereInput, { nullable: true, description: undefined, }) - none?: ArticleWhereInput | ArticleWhereInput[] | null; + none?: ArticleWhereInput; } diff --git a/src/@generated/article/article-list-relation-filter.input.ts b/src/@generated/article/article-list-relation-filter.input.ts index 33f3cf77..eb6caa3e 100644 --- a/src/@generated/article/article-list-relation-filter.input.ts +++ b/src/@generated/article/article-list-relation-filter.input.ts @@ -8,17 +8,17 @@ export class ArticleListRelationFilter { nullable: true, description: undefined, }) - every?: ArticleWhereInput | null; + every?: ArticleWhereInput; @Field(() => ArticleWhereInput, { nullable: true, description: undefined, }) - some?: ArticleWhereInput | null; + some?: ArticleWhereInput; @Field(() => ArticleWhereInput, { nullable: true, description: undefined, }) - none?: ArticleWhereInput | null; + none?: ArticleWhereInput; } diff --git a/src/@generated/article/article-order-by.input.ts b/src/@generated/article/article-order-by.input.ts index f86dd18f..9c233f60 100644 --- a/src/@generated/article/article-order-by.input.ts +++ b/src/@generated/article/article-order-by.input.ts @@ -8,55 +8,55 @@ export class ArticleOrderByInput { nullable: true, description: undefined, }) - id?: SortOrder | null; + id?: SortOrder; @Field(() => SortOrder, { nullable: true, description: undefined, }) - slug?: SortOrder | null; + slug?: SortOrder; @Field(() => SortOrder, { nullable: true, description: undefined, }) - title?: SortOrder | null; + title?: SortOrder; @Field(() => SortOrder, { nullable: true, description: undefined, }) - description?: SortOrder | null; + description?: SortOrder; @Field(() => SortOrder, { nullable: true, description: undefined, }) - body?: SortOrder | null; + body?: SortOrder; @Field(() => SortOrder, { nullable: true, description: undefined, }) - createdAt?: SortOrder | null; + createdAt?: SortOrder; @Field(() => SortOrder, { nullable: true, description: undefined, }) - updatedAt?: SortOrder | null; + updatedAt?: SortOrder; @Field(() => SortOrder, { nullable: true, description: undefined, }) - favoritesCount?: SortOrder | null; + favoritesCount?: SortOrder; @Field(() => SortOrder, { nullable: true, description: undefined, }) - authorId?: SortOrder | null; + authorId?: SortOrder; @Field(() => SortOrder, { nullable: true, diff --git a/src/@generated/article/article-scalar-where.input.ts b/src/@generated/article/article-scalar-where.input.ts index 8877f627..23256f37 100644 --- a/src/@generated/article/article-scalar-where.input.ts +++ b/src/@generated/article/article-scalar-where.input.ts @@ -14,31 +14,31 @@ export class ArticleScalarWhereInput { nullable: true, description: undefined, }) - id?: string | StringFilter | null; + id?: string | StringFilter; @Field(() => StringFilter, { nullable: true, description: undefined, }) - slug?: string | StringFilter | null; + slug?: string | StringFilter; @Field(() => StringFilter, { nullable: true, description: undefined, }) - title?: string | StringFilter | null; + title?: string | StringFilter; @Field(() => StringFilter, { nullable: true, description: undefined, }) - description?: string | StringFilter | null; + description?: string | StringFilter; @Field(() => StringFilter, { nullable: true, description: undefined, }) - body?: string | StringFilter | null; + body?: string | StringFilter; @Field(() => TagFilter, { nullable: true, @@ -50,25 +50,25 @@ export class ArticleScalarWhereInput { nullable: true, description: undefined, }) - createdAt?: string | DateTimeFilter | null; + createdAt?: Date | string | DateTimeFilter; @Field(() => DateTimeFilter, { nullable: true, description: undefined, }) - updatedAt?: string | DateTimeFilter | null; + updatedAt?: Date | string | DateTimeFilter; @Field(() => IntFilter, { nullable: true, description: undefined, }) - favoritesCount?: number | IntFilter | null; + favoritesCount?: number | IntFilter; @Field(() => StringFilter, { nullable: true, description: undefined, }) - authorId?: string | StringFilter | null; + authorId?: string | StringFilter; @Field(() => UserFilter, { nullable: true, @@ -92,17 +92,17 @@ export class ArticleScalarWhereInput { nullable: true, description: undefined, }) - AND?: ArticleScalarWhereInput | ArticleScalarWhereInput[] | null; + AND?: ArticleScalarWhereInput | Array; @Field(() => [ArticleScalarWhereInput], { nullable: true, description: undefined, }) - OR?: ArticleScalarWhereInput | ArticleScalarWhereInput[] | null; + OR?: Array; @Field(() => [ArticleScalarWhereInput], { nullable: true, description: undefined, }) - NOT?: ArticleScalarWhereInput | ArticleScalarWhereInput[] | null; + NOT?: ArticleScalarWhereInput | Array; } diff --git a/src/@generated/article/article-update-many-data.input.ts b/src/@generated/article/article-update-many-data.input.ts index 704be0a3..b789dd3b 100644 --- a/src/@generated/article/article-update-many-data.input.ts +++ b/src/@generated/article/article-update-many-data.input.ts @@ -6,49 +6,49 @@ export class ArticleUpdateManyDataInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - slug?: string | null; + slug?: string; @Field(() => String, { nullable: true, description: undefined, }) - title?: string | null; + title?: string; @Field(() => String, { nullable: true, description: undefined, }) - description?: string | null; + description?: string; @Field(() => String, { nullable: true, description: undefined, }) - body?: string | null; + body?: string; @Field(() => String, { nullable: true, description: undefined, }) - createdAt?: string | null; + createdAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - updatedAt?: string | null; + updatedAt?: Date | string; @Field(() => Int, { nullable: true, description: undefined, }) - favoritesCount?: number | null; + favoritesCount?: number; @Field(() => Boolean, { nullable: true, diff --git a/src/@generated/article/article-update-many-mutation.input.ts b/src/@generated/article/article-update-many-mutation.input.ts index 0441ec07..96993003 100644 --- a/src/@generated/article/article-update-many-mutation.input.ts +++ b/src/@generated/article/article-update-many-mutation.input.ts @@ -6,49 +6,49 @@ export class ArticleUpdateManyMutationInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - slug?: string | null; + slug?: string; @Field(() => String, { nullable: true, description: undefined, }) - title?: string | null; + title?: string; @Field(() => String, { nullable: true, description: undefined, }) - description?: string | null; + description?: string; @Field(() => String, { nullable: true, description: undefined, }) - body?: string | null; + body?: string; @Field(() => String, { nullable: true, description: undefined, }) - createdAt?: string | null; + createdAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - updatedAt?: string | null; + updatedAt?: Date | string; @Field(() => Int, { nullable: true, description: undefined, }) - favoritesCount?: number | null; + favoritesCount?: number; @Field(() => Boolean, { nullable: true, diff --git a/src/@generated/article/article-update-many-with-where-nested.input.ts b/src/@generated/article/article-update-many-with-where-nested.input.ts index 70ee1c87..14e4efa6 100644 --- a/src/@generated/article/article-update-many-with-where-nested.input.ts +++ b/src/@generated/article/article-update-many-with-where-nested.input.ts @@ -9,11 +9,11 @@ export class ArticleUpdateManyWithWhereNestedInput { nullable: true, description: undefined, }) - where?: ArticleScalarWhereInput | null; + where?: ArticleScalarWhereInput; @Field(() => ArticleUpdateManyDataInput, { nullable: true, description: undefined, }) - data?: ArticleUpdateManyDataInput | null; + data?: ArticleUpdateManyDataInput; } diff --git a/src/@generated/article/article-update-many-without-author.input.ts b/src/@generated/article/article-update-many-without-author.input.ts index 741f74bd..2549c369 100644 --- a/src/@generated/article/article-update-many-without-author.input.ts +++ b/src/@generated/article/article-update-many-without-author.input.ts @@ -13,62 +13,53 @@ export class ArticleUpdateManyWithoutAuthorInput { nullable: true, description: undefined, }) - create?: ArticleCreateWithoutAuthorInput | ArticleCreateWithoutAuthorInput[] | null; + create?: Array; @Field(() => [ArticleWhereUniqueInput], { nullable: true, description: undefined, }) - connect?: ArticleWhereUniqueInput | ArticleWhereUniqueInput[] | null; + connect?: Array; @Field(() => [ArticleWhereUniqueInput], { nullable: true, description: undefined, }) - set?: ArticleWhereUniqueInput | ArticleWhereUniqueInput[] | null; + set?: Array; @Field(() => [ArticleWhereUniqueInput], { nullable: true, description: undefined, }) - disconnect?: ArticleWhereUniqueInput | ArticleWhereUniqueInput[] | null; + disconnect?: Array; @Field(() => [ArticleWhereUniqueInput], { nullable: true, description: undefined, }) - delete?: ArticleWhereUniqueInput | ArticleWhereUniqueInput[] | null; + delete?: Array; @Field(() => [ArticleUpdateWithWhereUniqueWithoutAuthorInput], { nullable: true, description: undefined, }) - update?: - | ArticleUpdateWithWhereUniqueWithoutAuthorInput - | ArticleUpdateWithWhereUniqueWithoutAuthorInput[] - | null; + update?: Array; @Field(() => [ArticleUpdateManyWithWhereNestedInput], { nullable: true, description: undefined, }) - updateMany?: - | ArticleUpdateManyWithWhereNestedInput - | ArticleUpdateManyWithWhereNestedInput[] - | null; + updateMany?: Array | null; @Field(() => [ArticleScalarWhereInput], { nullable: true, description: undefined, }) - deleteMany?: ArticleScalarWhereInput | ArticleScalarWhereInput[] | null; + deleteMany?: Array; @Field(() => [ArticleUpsertWithWhereUniqueWithoutAuthorInput], { nullable: true, description: undefined, }) - upsert?: - | ArticleUpsertWithWhereUniqueWithoutAuthorInput - | ArticleUpsertWithWhereUniqueWithoutAuthorInput[] - | null; + upsert?: Array; } diff --git a/src/@generated/article/article-update-many-without-favorited-by.input.ts b/src/@generated/article/article-update-many-without-favorited-by.input.ts index fbf6fad6..cd7ba98e 100644 --- a/src/@generated/article/article-update-many-without-favorited-by.input.ts +++ b/src/@generated/article/article-update-many-without-favorited-by.input.ts @@ -13,62 +13,53 @@ export class ArticleUpdateManyWithoutFavoritedByInput { nullable: true, description: undefined, }) - create?: ArticleCreateWithoutFavoritedByInput | ArticleCreateWithoutFavoritedByInput[] | null; + create?: Array; @Field(() => [ArticleWhereUniqueInput], { nullable: true, description: undefined, }) - connect?: ArticleWhereUniqueInput | ArticleWhereUniqueInput[] | null; + connect?: Array; @Field(() => [ArticleWhereUniqueInput], { nullable: true, description: undefined, }) - set?: ArticleWhereUniqueInput | ArticleWhereUniqueInput[] | null; + set?: Array; @Field(() => [ArticleWhereUniqueInput], { nullable: true, description: undefined, }) - disconnect?: ArticleWhereUniqueInput | ArticleWhereUniqueInput[] | null; + disconnect?: Array; @Field(() => [ArticleWhereUniqueInput], { nullable: true, description: undefined, }) - delete?: ArticleWhereUniqueInput | ArticleWhereUniqueInput[] | null; + delete?: Array; @Field(() => [ArticleUpdateWithWhereUniqueWithoutFavoritedByInput], { nullable: true, description: undefined, }) - update?: - | ArticleUpdateWithWhereUniqueWithoutFavoritedByInput - | ArticleUpdateWithWhereUniqueWithoutFavoritedByInput[] - | null; + update?: Array; @Field(() => [ArticleUpdateManyWithWhereNestedInput], { nullable: true, description: undefined, }) - updateMany?: - | ArticleUpdateManyWithWhereNestedInput - | ArticleUpdateManyWithWhereNestedInput[] - | null; + updateMany?: Array | null; @Field(() => [ArticleScalarWhereInput], { nullable: true, description: undefined, }) - deleteMany?: ArticleScalarWhereInput | ArticleScalarWhereInput[] | null; + deleteMany?: Array; @Field(() => [ArticleUpsertWithWhereUniqueWithoutFavoritedByInput], { nullable: true, description: undefined, }) - upsert?: - | ArticleUpsertWithWhereUniqueWithoutFavoritedByInput - | ArticleUpsertWithWhereUniqueWithoutFavoritedByInput[] - | null; + upsert?: Array; } diff --git a/src/@generated/article/article-update-many-without-tags.input.ts b/src/@generated/article/article-update-many-without-tags.input.ts index f5511d1b..f387d02a 100644 --- a/src/@generated/article/article-update-many-without-tags.input.ts +++ b/src/@generated/article/article-update-many-without-tags.input.ts @@ -13,62 +13,53 @@ export class ArticleUpdateManyWithoutTagsInput { nullable: true, description: undefined, }) - create?: ArticleCreateWithoutTagsInput | ArticleCreateWithoutTagsInput[] | null; + create?: Array; @Field(() => [ArticleWhereUniqueInput], { nullable: true, description: undefined, }) - connect?: ArticleWhereUniqueInput | ArticleWhereUniqueInput[] | null; + connect?: Array; @Field(() => [ArticleWhereUniqueInput], { nullable: true, description: undefined, }) - set?: ArticleWhereUniqueInput | ArticleWhereUniqueInput[] | null; + set?: Array; @Field(() => [ArticleWhereUniqueInput], { nullable: true, description: undefined, }) - disconnect?: ArticleWhereUniqueInput | ArticleWhereUniqueInput[] | null; + disconnect?: Array; @Field(() => [ArticleWhereUniqueInput], { nullable: true, description: undefined, }) - delete?: ArticleWhereUniqueInput | ArticleWhereUniqueInput[] | null; + delete?: Array; @Field(() => [ArticleUpdateWithWhereUniqueWithoutTagsInput], { nullable: true, description: undefined, }) - update?: - | ArticleUpdateWithWhereUniqueWithoutTagsInput - | ArticleUpdateWithWhereUniqueWithoutTagsInput[] - | null; + update?: Array; @Field(() => [ArticleUpdateManyWithWhereNestedInput], { nullable: true, description: undefined, }) - updateMany?: - | ArticleUpdateManyWithWhereNestedInput - | ArticleUpdateManyWithWhereNestedInput[] - | null; + updateMany?: Array | null; @Field(() => [ArticleScalarWhereInput], { nullable: true, description: undefined, }) - deleteMany?: ArticleScalarWhereInput | ArticleScalarWhereInput[] | null; + deleteMany?: Array; @Field(() => [ArticleUpsertWithWhereUniqueWithoutTagsInput], { nullable: true, description: undefined, }) - upsert?: - | ArticleUpsertWithWhereUniqueWithoutTagsInput - | ArticleUpsertWithWhereUniqueWithoutTagsInput[] - | null; + upsert?: Array; } diff --git a/src/@generated/article/article-update-one-without-comments.input.ts b/src/@generated/article/article-update-one-without-comments.input.ts index aa630da1..b1e6ccca 100644 --- a/src/@generated/article/article-update-one-without-comments.input.ts +++ b/src/@generated/article/article-update-one-without-comments.input.ts @@ -11,35 +11,35 @@ export class ArticleUpdateOneWithoutCommentsInput { nullable: true, description: undefined, }) - create?: ArticleCreateWithoutCommentsInput | null; + create?: ArticleCreateWithoutCommentsInput; @Field(() => ArticleWhereUniqueInput, { nullable: true, description: undefined, }) - connect?: ArticleWhereUniqueInput | null; + connect?: ArticleWhereUniqueInput; @Field(() => Boolean, { nullable: true, description: undefined, }) - disconnect?: boolean | null; + disconnect?: boolean; @Field(() => Boolean, { nullable: true, description: undefined, }) - delete?: boolean | null; + delete?: boolean; @Field(() => ArticleUpdateWithoutCommentsDataInput, { nullable: true, description: undefined, }) - update?: ArticleUpdateWithoutCommentsDataInput | null; + update?: ArticleUpdateWithoutCommentsDataInput; @Field(() => ArticleUpsertWithoutCommentsInput, { nullable: true, description: undefined, }) - upsert?: ArticleUpsertWithoutCommentsInput | null; + upsert?: ArticleUpsertWithoutCommentsInput; } diff --git a/src/@generated/article/article-update-with-where-unique-without-author.input.ts b/src/@generated/article/article-update-with-where-unique-without-author.input.ts index 2491d086..9954b5a1 100644 --- a/src/@generated/article/article-update-with-where-unique-without-author.input.ts +++ b/src/@generated/article/article-update-with-where-unique-without-author.input.ts @@ -9,11 +9,11 @@ export class ArticleUpdateWithWhereUniqueWithoutAuthorInput { nullable: true, description: undefined, }) - where?: ArticleWhereUniqueInput | null; + where?: ArticleWhereUniqueInput; @Field(() => ArticleUpdateWithoutAuthorDataInput, { nullable: true, description: undefined, }) - data?: ArticleUpdateWithoutAuthorDataInput | null; + data?: ArticleUpdateWithoutAuthorDataInput; } diff --git a/src/@generated/article/article-update-with-where-unique-without-favorited-by.input.ts b/src/@generated/article/article-update-with-where-unique-without-favorited-by.input.ts index 07d638aa..07dbad64 100644 --- a/src/@generated/article/article-update-with-where-unique-without-favorited-by.input.ts +++ b/src/@generated/article/article-update-with-where-unique-without-favorited-by.input.ts @@ -9,11 +9,11 @@ export class ArticleUpdateWithWhereUniqueWithoutFavoritedByInput { nullable: true, description: undefined, }) - where?: ArticleWhereUniqueInput | null; + where?: ArticleWhereUniqueInput; @Field(() => ArticleUpdateWithoutFavoritedByDataInput, { nullable: true, description: undefined, }) - data?: ArticleUpdateWithoutFavoritedByDataInput | null; + data?: ArticleUpdateWithoutFavoritedByDataInput; } diff --git a/src/@generated/article/article-update-with-where-unique-without-tags.input.ts b/src/@generated/article/article-update-with-where-unique-without-tags.input.ts index 8ae621ab..3928d08b 100644 --- a/src/@generated/article/article-update-with-where-unique-without-tags.input.ts +++ b/src/@generated/article/article-update-with-where-unique-without-tags.input.ts @@ -9,11 +9,11 @@ export class ArticleUpdateWithWhereUniqueWithoutTagsInput { nullable: true, description: undefined, }) - where?: ArticleWhereUniqueInput | null; + where?: ArticleWhereUniqueInput; @Field(() => ArticleUpdateWithoutTagsDataInput, { nullable: true, description: undefined, }) - data?: ArticleUpdateWithoutTagsDataInput | null; + data?: ArticleUpdateWithoutTagsDataInput; } diff --git a/src/@generated/article/article-update-without-author-data.input.ts b/src/@generated/article/article-update-without-author-data.input.ts index 40ee7d24..2a4e741c 100644 --- a/src/@generated/article/article-update-without-author-data.input.ts +++ b/src/@generated/article/article-update-without-author-data.input.ts @@ -10,49 +10,49 @@ export class ArticleUpdateWithoutAuthorDataInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - slug?: string | null; + slug?: string; @Field(() => String, { nullable: true, description: undefined, }) - title?: string | null; + title?: string; @Field(() => String, { nullable: true, description: undefined, }) - description?: string | null; + description?: string; @Field(() => String, { nullable: true, description: undefined, }) - body?: string | null; + body?: string; @Field(() => String, { nullable: true, description: undefined, }) - createdAt?: string | null; + createdAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - updatedAt?: string | null; + updatedAt?: Date | string; @Field(() => Int, { nullable: true, description: undefined, }) - favoritesCount?: number | null; + favoritesCount?: number; @Field(() => Boolean, { nullable: true, diff --git a/src/@generated/article/article-update-without-comments-data.input.ts b/src/@generated/article/article-update-without-comments-data.input.ts index 797c7e2f..42327464 100644 --- a/src/@generated/article/article-update-without-comments-data.input.ts +++ b/src/@generated/article/article-update-without-comments-data.input.ts @@ -10,49 +10,49 @@ export class ArticleUpdateWithoutCommentsDataInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - slug?: string | null; + slug?: string; @Field(() => String, { nullable: true, description: undefined, }) - title?: string | null; + title?: string; @Field(() => String, { nullable: true, description: undefined, }) - description?: string | null; + description?: string; @Field(() => String, { nullable: true, description: undefined, }) - body?: string | null; + body?: string; @Field(() => String, { nullable: true, description: undefined, }) - createdAt?: string | null; + createdAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - updatedAt?: string | null; + updatedAt?: Date | string; @Field(() => Int, { nullable: true, description: undefined, }) - favoritesCount?: number | null; + favoritesCount?: number; @Field(() => Boolean, { nullable: true, @@ -70,7 +70,7 @@ export class ArticleUpdateWithoutCommentsDataInput { nullable: true, description: undefined, }) - author?: UserUpdateOneRequiredWithoutArticlesInput | null; + author?: UserUpdateOneRequiredWithoutArticlesInput; @Field(() => UserUpdateManyWithoutFavoriteArticlesInput, { nullable: true, diff --git a/src/@generated/article/article-update-without-favorited-by-data.input.ts b/src/@generated/article/article-update-without-favorited-by-data.input.ts index 16676fc7..0cdd5847 100644 --- a/src/@generated/article/article-update-without-favorited-by-data.input.ts +++ b/src/@generated/article/article-update-without-favorited-by-data.input.ts @@ -10,49 +10,49 @@ export class ArticleUpdateWithoutFavoritedByDataInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - slug?: string | null; + slug?: string; @Field(() => String, { nullable: true, description: undefined, }) - title?: string | null; + title?: string; @Field(() => String, { nullable: true, description: undefined, }) - description?: string | null; + description?: string; @Field(() => String, { nullable: true, description: undefined, }) - body?: string | null; + body?: string; @Field(() => String, { nullable: true, description: undefined, }) - createdAt?: string | null; + createdAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - updatedAt?: string | null; + updatedAt?: Date | string; @Field(() => Int, { nullable: true, description: undefined, }) - favoritesCount?: number | null; + favoritesCount?: number; @Field(() => Boolean, { nullable: true, @@ -70,7 +70,7 @@ export class ArticleUpdateWithoutFavoritedByDataInput { nullable: true, description: undefined, }) - author?: UserUpdateOneRequiredWithoutArticlesInput | null; + author?: UserUpdateOneRequiredWithoutArticlesInput; @Field(() => CommentUpdateManyWithoutArticleInput, { nullable: true, diff --git a/src/@generated/article/article-update-without-tags-data.input.ts b/src/@generated/article/article-update-without-tags-data.input.ts index 9f502c14..27ae8f7b 100644 --- a/src/@generated/article/article-update-without-tags-data.input.ts +++ b/src/@generated/article/article-update-without-tags-data.input.ts @@ -10,49 +10,49 @@ export class ArticleUpdateWithoutTagsDataInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - slug?: string | null; + slug?: string; @Field(() => String, { nullable: true, description: undefined, }) - title?: string | null; + title?: string; @Field(() => String, { nullable: true, description: undefined, }) - description?: string | null; + description?: string; @Field(() => String, { nullable: true, description: undefined, }) - body?: string | null; + body?: string; @Field(() => String, { nullable: true, description: undefined, }) - createdAt?: string | null; + createdAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - updatedAt?: string | null; + updatedAt?: Date | string; @Field(() => Int, { nullable: true, description: undefined, }) - favoritesCount?: number | null; + favoritesCount?: number; @Field(() => Boolean, { nullable: true, @@ -64,7 +64,7 @@ export class ArticleUpdateWithoutTagsDataInput { nullable: true, description: undefined, }) - author?: UserUpdateOneRequiredWithoutArticlesInput | null; + author?: UserUpdateOneRequiredWithoutArticlesInput; @Field(() => UserUpdateManyWithoutFavoriteArticlesInput, { nullable: true, diff --git a/src/@generated/article/article-update.input.ts b/src/@generated/article/article-update.input.ts index 427bf8ab..8519faa8 100644 --- a/src/@generated/article/article-update.input.ts +++ b/src/@generated/article/article-update.input.ts @@ -11,49 +11,49 @@ export class ArticleUpdateInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - slug?: string | null; + slug?: string; @Field(() => String, { nullable: true, description: undefined, }) - title?: string | null; + title?: string; @Field(() => String, { nullable: true, description: undefined, }) - description?: string | null; + description?: string; @Field(() => String, { nullable: true, description: undefined, }) - body?: string | null; + body?: string; @Field(() => String, { nullable: true, description: undefined, }) - createdAt?: string | null; + createdAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - updatedAt?: string | null; + updatedAt?: Date | string; @Field(() => Int, { nullable: true, description: undefined, }) - favoritesCount?: number | null; + favoritesCount?: number; @Field(() => Boolean, { nullable: true, @@ -71,7 +71,7 @@ export class ArticleUpdateInput { nullable: true, description: undefined, }) - author?: UserUpdateOneRequiredWithoutArticlesInput | null; + author?: UserUpdateOneRequiredWithoutArticlesInput; @Field(() => UserUpdateManyWithoutFavoriteArticlesInput, { nullable: true, diff --git a/src/@generated/article/article-upsert-with-where-unique-without-author.input.ts b/src/@generated/article/article-upsert-with-where-unique-without-author.input.ts index 08bf11c0..19ffbe9f 100644 --- a/src/@generated/article/article-upsert-with-where-unique-without-author.input.ts +++ b/src/@generated/article/article-upsert-with-where-unique-without-author.input.ts @@ -10,17 +10,17 @@ export class ArticleUpsertWithWhereUniqueWithoutAuthorInput { nullable: true, description: undefined, }) - where?: ArticleWhereUniqueInput | null; + where?: ArticleWhereUniqueInput; @Field(() => ArticleUpdateWithoutAuthorDataInput, { nullable: true, description: undefined, }) - update?: ArticleUpdateWithoutAuthorDataInput | null; + update?: ArticleUpdateWithoutAuthorDataInput; @Field(() => ArticleCreateWithoutAuthorInput, { nullable: true, description: undefined, }) - create?: ArticleCreateWithoutAuthorInput | null; + create?: ArticleCreateWithoutAuthorInput; } diff --git a/src/@generated/article/article-upsert-with-where-unique-without-favorited-by.input.ts b/src/@generated/article/article-upsert-with-where-unique-without-favorited-by.input.ts index 44fd5dd9..89b5a3c9 100644 --- a/src/@generated/article/article-upsert-with-where-unique-without-favorited-by.input.ts +++ b/src/@generated/article/article-upsert-with-where-unique-without-favorited-by.input.ts @@ -10,17 +10,17 @@ export class ArticleUpsertWithWhereUniqueWithoutFavoritedByInput { nullable: true, description: undefined, }) - where?: ArticleWhereUniqueInput | null; + where?: ArticleWhereUniqueInput; @Field(() => ArticleUpdateWithoutFavoritedByDataInput, { nullable: true, description: undefined, }) - update?: ArticleUpdateWithoutFavoritedByDataInput | null; + update?: ArticleUpdateWithoutFavoritedByDataInput; @Field(() => ArticleCreateWithoutFavoritedByInput, { nullable: true, description: undefined, }) - create?: ArticleCreateWithoutFavoritedByInput | null; + create?: ArticleCreateWithoutFavoritedByInput; } diff --git a/src/@generated/article/article-upsert-with-where-unique-without-tags.input.ts b/src/@generated/article/article-upsert-with-where-unique-without-tags.input.ts index 8cfc7e26..107b6ca8 100644 --- a/src/@generated/article/article-upsert-with-where-unique-without-tags.input.ts +++ b/src/@generated/article/article-upsert-with-where-unique-without-tags.input.ts @@ -10,17 +10,17 @@ export class ArticleUpsertWithWhereUniqueWithoutTagsInput { nullable: true, description: undefined, }) - where?: ArticleWhereUniqueInput | null; + where?: ArticleWhereUniqueInput; @Field(() => ArticleUpdateWithoutTagsDataInput, { nullable: true, description: undefined, }) - update?: ArticleUpdateWithoutTagsDataInput | null; + update?: ArticleUpdateWithoutTagsDataInput; @Field(() => ArticleCreateWithoutTagsInput, { nullable: true, description: undefined, }) - create?: ArticleCreateWithoutTagsInput | null; + create?: ArticleCreateWithoutTagsInput; } diff --git a/src/@generated/article/article-upsert-without-comments.input.ts b/src/@generated/article/article-upsert-without-comments.input.ts index dc75dae3..a7540342 100644 --- a/src/@generated/article/article-upsert-without-comments.input.ts +++ b/src/@generated/article/article-upsert-without-comments.input.ts @@ -9,11 +9,11 @@ export class ArticleUpsertWithoutCommentsInput { nullable: true, description: undefined, }) - update?: ArticleUpdateWithoutCommentsDataInput | null; + update?: ArticleUpdateWithoutCommentsDataInput; @Field(() => ArticleCreateWithoutCommentsInput, { nullable: true, description: undefined, }) - create?: ArticleCreateWithoutCommentsInput | null; + create?: ArticleCreateWithoutCommentsInput; } diff --git a/src/@generated/article/article-where-unique.input.ts b/src/@generated/article/article-where-unique.input.ts index 85dcef8b..fa1e5b52 100644 --- a/src/@generated/article/article-where-unique.input.ts +++ b/src/@generated/article/article-where-unique.input.ts @@ -6,11 +6,11 @@ export class ArticleWhereUniqueInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - slug?: string | null; + slug?: string; } diff --git a/src/@generated/article/article-where.input.ts b/src/@generated/article/article-where.input.ts index 412e1c0e..6a3391d8 100644 --- a/src/@generated/article/article-where.input.ts +++ b/src/@generated/article/article-where.input.ts @@ -15,31 +15,31 @@ export class ArticleWhereInput { nullable: true, description: undefined, }) - id?: string | StringFilter | null; + id?: string | StringFilter; @Field(() => StringFilter, { nullable: true, description: undefined, }) - slug?: string | StringFilter | null; + slug?: string | StringFilter; @Field(() => StringFilter, { nullable: true, description: undefined, }) - title?: string | StringFilter | null; + title?: string | StringFilter; @Field(() => StringFilter, { nullable: true, description: undefined, }) - description?: string | StringFilter | null; + description?: string | StringFilter; @Field(() => StringFilter, { nullable: true, description: undefined, }) - body?: string | StringFilter | null; + body?: string | StringFilter; @Field(() => TagFilter, { nullable: true, @@ -51,25 +51,25 @@ export class ArticleWhereInput { nullable: true, description: undefined, }) - createdAt?: string | DateTimeFilter | null; + createdAt?: Date | string | DateTimeFilter; @Field(() => DateTimeFilter, { nullable: true, description: undefined, }) - updatedAt?: string | DateTimeFilter | null; + updatedAt?: Date | string | DateTimeFilter; @Field(() => IntFilter, { nullable: true, description: undefined, }) - favoritesCount?: number | IntFilter | null; + favoritesCount?: number | IntFilter; @Field(() => StringFilter, { nullable: true, description: undefined, }) - authorId?: string | StringFilter | null; + authorId?: string | StringFilter; @Field(() => UserFilter, { nullable: true, @@ -93,23 +93,23 @@ export class ArticleWhereInput { nullable: true, description: undefined, }) - AND?: ArticleWhereInput | ArticleWhereInput[] | null; + AND?: ArticleWhereInput | Array; @Field(() => [ArticleWhereInput], { nullable: true, description: undefined, }) - OR?: ArticleWhereInput | ArticleWhereInput[] | null; + OR?: Array; @Field(() => [ArticleWhereInput], { nullable: true, description: undefined, }) - NOT?: ArticleWhereInput | ArticleWhereInput[] | null; + NOT?: ArticleWhereInput | Array; @Field(() => UserRelationFilter, { nullable: true, description: undefined, }) - author?: UserRelationFilter | UserRelationFilter[] | null; + author?: UserRelationFilter; } diff --git a/src/@generated/article/article.model.ts b/src/@generated/article/article.model.ts index 0bcfe8b5..6d0b9a9b 100644 --- a/src/@generated/article/article.model.ts +++ b/src/@generated/article/article.model.ts @@ -48,13 +48,13 @@ export class Article { nullable: false, description: undefined, }) - createdAt!: string; + createdAt!: Date | string; @Field(() => String, { nullable: false, description: undefined, }) - updatedAt!: string; + updatedAt!: Date | string; @Field(() => Int, { nullable: false, diff --git a/src/@generated/comment/comment-create-many-without-article.input.ts b/src/@generated/comment/comment-create-many-without-article.input.ts index df3f5253..bebb77ae 100644 --- a/src/@generated/comment/comment-create-many-without-article.input.ts +++ b/src/@generated/comment/comment-create-many-without-article.input.ts @@ -9,11 +9,11 @@ export class CommentCreateManyWithoutArticleInput { nullable: true, description: undefined, }) - create?: CommentCreateWithoutArticleInput | CommentCreateWithoutArticleInput[] | null; + create?: Array; @Field(() => [CommentWhereUniqueInput], { nullable: true, description: undefined, }) - connect?: CommentWhereUniqueInput | CommentWhereUniqueInput[] | null; + connect?: Array; } diff --git a/src/@generated/comment/comment-create-many-without-author.input.ts b/src/@generated/comment/comment-create-many-without-author.input.ts index 872a7e2e..a3564838 100644 --- a/src/@generated/comment/comment-create-many-without-author.input.ts +++ b/src/@generated/comment/comment-create-many-without-author.input.ts @@ -9,11 +9,11 @@ export class CommentCreateManyWithoutAuthorInput { nullable: true, description: undefined, }) - create?: CommentCreateWithoutAuthorInput | CommentCreateWithoutAuthorInput[] | null; + create?: Array; @Field(() => [CommentWhereUniqueInput], { nullable: true, description: undefined, }) - connect?: CommentWhereUniqueInput | CommentWhereUniqueInput[] | null; + connect?: Array; } diff --git a/src/@generated/comment/comment-create-without-article.input.ts b/src/@generated/comment/comment-create-without-article.input.ts index f57a1f58..d4a8efb9 100644 --- a/src/@generated/comment/comment-create-without-article.input.ts +++ b/src/@generated/comment/comment-create-without-article.input.ts @@ -8,29 +8,29 @@ export class CommentCreateWithoutArticleInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - createdAt?: string | null; + createdAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - updatedAt?: string | null; + updatedAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - body?: string | null; + body?: string; @Field(() => UserCreateOneWithoutCommentsInput, { nullable: true, description: undefined, }) - author?: UserCreateOneWithoutCommentsInput | null; + author?: UserCreateOneWithoutCommentsInput; } diff --git a/src/@generated/comment/comment-create-without-author.input.ts b/src/@generated/comment/comment-create-without-author.input.ts index 5cd09358..d5bc72e1 100644 --- a/src/@generated/comment/comment-create-without-author.input.ts +++ b/src/@generated/comment/comment-create-without-author.input.ts @@ -8,25 +8,25 @@ export class CommentCreateWithoutAuthorInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - createdAt?: string | null; + createdAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - updatedAt?: string | null; + updatedAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - body?: string | null; + body?: string; @Field(() => ArticleCreateOneWithoutCommentsInput, { nullable: true, diff --git a/src/@generated/comment/comment-create.input.ts b/src/@generated/comment/comment-create.input.ts index 6bbb4685..be9e0612 100644 --- a/src/@generated/comment/comment-create.input.ts +++ b/src/@generated/comment/comment-create.input.ts @@ -9,31 +9,31 @@ export class CommentCreateInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - createdAt?: string | null; + createdAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - updatedAt?: string | null; + updatedAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - body?: string | null; + body?: string; @Field(() => UserCreateOneWithoutCommentsInput, { nullable: true, description: undefined, }) - author?: UserCreateOneWithoutCommentsInput | null; + author?: UserCreateOneWithoutCommentsInput; @Field(() => ArticleCreateOneWithoutCommentsInput, { nullable: true, diff --git a/src/@generated/comment/comment-filter.input.ts b/src/@generated/comment/comment-filter.input.ts index 2e2323ca..23d515b5 100644 --- a/src/@generated/comment/comment-filter.input.ts +++ b/src/@generated/comment/comment-filter.input.ts @@ -8,17 +8,17 @@ export class CommentFilter { nullable: true, description: undefined, }) - every?: CommentWhereInput | CommentWhereInput[] | null; + every?: CommentWhereInput; @Field(() => CommentWhereInput, { nullable: true, description: undefined, }) - some?: CommentWhereInput | CommentWhereInput[] | null; + some?: CommentWhereInput; @Field(() => CommentWhereInput, { nullable: true, description: undefined, }) - none?: CommentWhereInput | CommentWhereInput[] | null; + none?: CommentWhereInput; } diff --git a/src/@generated/comment/comment-list-relation-filter.input.ts b/src/@generated/comment/comment-list-relation-filter.input.ts index 986757ab..6c606fa6 100644 --- a/src/@generated/comment/comment-list-relation-filter.input.ts +++ b/src/@generated/comment/comment-list-relation-filter.input.ts @@ -8,17 +8,17 @@ export class CommentListRelationFilter { nullable: true, description: undefined, }) - every?: CommentWhereInput | null; + every?: CommentWhereInput; @Field(() => CommentWhereInput, { nullable: true, description: undefined, }) - some?: CommentWhereInput | null; + some?: CommentWhereInput; @Field(() => CommentWhereInput, { nullable: true, description: undefined, }) - none?: CommentWhereInput | null; + none?: CommentWhereInput; } diff --git a/src/@generated/comment/comment-order-by.input.ts b/src/@generated/comment/comment-order-by.input.ts index 98f0d1ce..b7cee0a4 100644 --- a/src/@generated/comment/comment-order-by.input.ts +++ b/src/@generated/comment/comment-order-by.input.ts @@ -8,31 +8,31 @@ export class CommentOrderByInput { nullable: true, description: undefined, }) - id?: SortOrder | null; + id?: SortOrder; @Field(() => SortOrder, { nullable: true, description: undefined, }) - createdAt?: SortOrder | null; + createdAt?: SortOrder; @Field(() => SortOrder, { nullable: true, description: undefined, }) - updatedAt?: SortOrder | null; + updatedAt?: SortOrder; @Field(() => SortOrder, { nullable: true, description: undefined, }) - body?: SortOrder | null; + body?: SortOrder; @Field(() => SortOrder, { nullable: true, description: undefined, }) - authorId?: SortOrder | null; + authorId?: SortOrder; @Field(() => SortOrder, { nullable: true, diff --git a/src/@generated/comment/comment-scalar-where.input.ts b/src/@generated/comment/comment-scalar-where.input.ts index 035358b3..f993c818 100644 --- a/src/@generated/comment/comment-scalar-where.input.ts +++ b/src/@generated/comment/comment-scalar-where.input.ts @@ -10,31 +10,31 @@ export class CommentScalarWhereInput { nullable: true, description: undefined, }) - id?: string | StringFilter | null; + id?: string | StringFilter; @Field(() => DateTimeFilter, { nullable: true, description: undefined, }) - createdAt?: string | DateTimeFilter | null; + createdAt?: Date | string | DateTimeFilter; @Field(() => DateTimeFilter, { nullable: true, description: undefined, }) - updatedAt?: string | DateTimeFilter | null; + updatedAt?: Date | string | DateTimeFilter; @Field(() => StringFilter, { nullable: true, description: undefined, }) - body?: string | StringFilter | null; + body?: string | StringFilter; @Field(() => StringFilter, { nullable: true, description: undefined, }) - authorId?: string | StringFilter | null; + authorId?: string | StringFilter; @Field(() => NullableStringFilter, { nullable: true, @@ -46,17 +46,17 @@ export class CommentScalarWhereInput { nullable: true, description: undefined, }) - AND?: CommentScalarWhereInput | CommentScalarWhereInput[] | null; + AND?: CommentScalarWhereInput | Array; @Field(() => [CommentScalarWhereInput], { nullable: true, description: undefined, }) - OR?: CommentScalarWhereInput | CommentScalarWhereInput[] | null; + OR?: Array; @Field(() => [CommentScalarWhereInput], { nullable: true, description: undefined, }) - NOT?: CommentScalarWhereInput | CommentScalarWhereInput[] | null; + NOT?: CommentScalarWhereInput | Array; } diff --git a/src/@generated/comment/comment-update-many-data.input.ts b/src/@generated/comment/comment-update-many-data.input.ts index 201bcd27..7a36bdf0 100644 --- a/src/@generated/comment/comment-update-many-data.input.ts +++ b/src/@generated/comment/comment-update-many-data.input.ts @@ -6,23 +6,23 @@ export class CommentUpdateManyDataInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - createdAt?: string | null; + createdAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - updatedAt?: string | null; + updatedAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - body?: string | null; + body?: string; } diff --git a/src/@generated/comment/comment-update-many-mutation.input.ts b/src/@generated/comment/comment-update-many-mutation.input.ts index 95dedce2..3dc50d42 100644 --- a/src/@generated/comment/comment-update-many-mutation.input.ts +++ b/src/@generated/comment/comment-update-many-mutation.input.ts @@ -6,23 +6,23 @@ export class CommentUpdateManyMutationInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - createdAt?: string | null; + createdAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - updatedAt?: string | null; + updatedAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - body?: string | null; + body?: string; } diff --git a/src/@generated/comment/comment-update-many-with-where-nested.input.ts b/src/@generated/comment/comment-update-many-with-where-nested.input.ts index 16e78fd9..87cd4d5c 100644 --- a/src/@generated/comment/comment-update-many-with-where-nested.input.ts +++ b/src/@generated/comment/comment-update-many-with-where-nested.input.ts @@ -9,11 +9,11 @@ export class CommentUpdateManyWithWhereNestedInput { nullable: true, description: undefined, }) - where?: CommentScalarWhereInput | null; + where?: CommentScalarWhereInput; @Field(() => CommentUpdateManyDataInput, { nullable: true, description: undefined, }) - data?: CommentUpdateManyDataInput | null; + data?: CommentUpdateManyDataInput; } diff --git a/src/@generated/comment/comment-update-many-without-article.input.ts b/src/@generated/comment/comment-update-many-without-article.input.ts index 138014ed..3d684fb2 100644 --- a/src/@generated/comment/comment-update-many-without-article.input.ts +++ b/src/@generated/comment/comment-update-many-without-article.input.ts @@ -13,62 +13,53 @@ export class CommentUpdateManyWithoutArticleInput { nullable: true, description: undefined, }) - create?: CommentCreateWithoutArticleInput | CommentCreateWithoutArticleInput[] | null; + create?: Array; @Field(() => [CommentWhereUniqueInput], { nullable: true, description: undefined, }) - connect?: CommentWhereUniqueInput | CommentWhereUniqueInput[] | null; + connect?: Array; @Field(() => [CommentWhereUniqueInput], { nullable: true, description: undefined, }) - set?: CommentWhereUniqueInput | CommentWhereUniqueInput[] | null; + set?: Array; @Field(() => [CommentWhereUniqueInput], { nullable: true, description: undefined, }) - disconnect?: CommentWhereUniqueInput | CommentWhereUniqueInput[] | null; + disconnect?: Array; @Field(() => [CommentWhereUniqueInput], { nullable: true, description: undefined, }) - delete?: CommentWhereUniqueInput | CommentWhereUniqueInput[] | null; + delete?: Array; @Field(() => [CommentUpdateWithWhereUniqueWithoutArticleInput], { nullable: true, description: undefined, }) - update?: - | CommentUpdateWithWhereUniqueWithoutArticleInput - | CommentUpdateWithWhereUniqueWithoutArticleInput[] - | null; + update?: Array; @Field(() => [CommentUpdateManyWithWhereNestedInput], { nullable: true, description: undefined, }) - updateMany?: - | CommentUpdateManyWithWhereNestedInput - | CommentUpdateManyWithWhereNestedInput[] - | null; + updateMany?: Array | null; @Field(() => [CommentScalarWhereInput], { nullable: true, description: undefined, }) - deleteMany?: CommentScalarWhereInput | CommentScalarWhereInput[] | null; + deleteMany?: Array; @Field(() => [CommentUpsertWithWhereUniqueWithoutArticleInput], { nullable: true, description: undefined, }) - upsert?: - | CommentUpsertWithWhereUniqueWithoutArticleInput - | CommentUpsertWithWhereUniqueWithoutArticleInput[] - | null; + upsert?: Array; } diff --git a/src/@generated/comment/comment-update-many-without-author.input.ts b/src/@generated/comment/comment-update-many-without-author.input.ts index 42cb7a9e..a3bd55af 100644 --- a/src/@generated/comment/comment-update-many-without-author.input.ts +++ b/src/@generated/comment/comment-update-many-without-author.input.ts @@ -13,62 +13,53 @@ export class CommentUpdateManyWithoutAuthorInput { nullable: true, description: undefined, }) - create?: CommentCreateWithoutAuthorInput | CommentCreateWithoutAuthorInput[] | null; + create?: Array; @Field(() => [CommentWhereUniqueInput], { nullable: true, description: undefined, }) - connect?: CommentWhereUniqueInput | CommentWhereUniqueInput[] | null; + connect?: Array; @Field(() => [CommentWhereUniqueInput], { nullable: true, description: undefined, }) - set?: CommentWhereUniqueInput | CommentWhereUniqueInput[] | null; + set?: Array; @Field(() => [CommentWhereUniqueInput], { nullable: true, description: undefined, }) - disconnect?: CommentWhereUniqueInput | CommentWhereUniqueInput[] | null; + disconnect?: Array; @Field(() => [CommentWhereUniqueInput], { nullable: true, description: undefined, }) - delete?: CommentWhereUniqueInput | CommentWhereUniqueInput[] | null; + delete?: Array; @Field(() => [CommentUpdateWithWhereUniqueWithoutAuthorInput], { nullable: true, description: undefined, }) - update?: - | CommentUpdateWithWhereUniqueWithoutAuthorInput - | CommentUpdateWithWhereUniqueWithoutAuthorInput[] - | null; + update?: Array; @Field(() => [CommentUpdateManyWithWhereNestedInput], { nullable: true, description: undefined, }) - updateMany?: - | CommentUpdateManyWithWhereNestedInput - | CommentUpdateManyWithWhereNestedInput[] - | null; + updateMany?: Array | null; @Field(() => [CommentScalarWhereInput], { nullable: true, description: undefined, }) - deleteMany?: CommentScalarWhereInput | CommentScalarWhereInput[] | null; + deleteMany?: Array; @Field(() => [CommentUpsertWithWhereUniqueWithoutAuthorInput], { nullable: true, description: undefined, }) - upsert?: - | CommentUpsertWithWhereUniqueWithoutAuthorInput - | CommentUpsertWithWhereUniqueWithoutAuthorInput[] - | null; + upsert?: Array; } diff --git a/src/@generated/comment/comment-update-with-where-unique-without-article.input.ts b/src/@generated/comment/comment-update-with-where-unique-without-article.input.ts index facf44ee..ab4cceb8 100644 --- a/src/@generated/comment/comment-update-with-where-unique-without-article.input.ts +++ b/src/@generated/comment/comment-update-with-where-unique-without-article.input.ts @@ -9,11 +9,11 @@ export class CommentUpdateWithWhereUniqueWithoutArticleInput { nullable: true, description: undefined, }) - where?: CommentWhereUniqueInput | null; + where?: CommentWhereUniqueInput; @Field(() => CommentUpdateWithoutArticleDataInput, { nullable: true, description: undefined, }) - data?: CommentUpdateWithoutArticleDataInput | null; + data?: CommentUpdateWithoutArticleDataInput; } diff --git a/src/@generated/comment/comment-update-with-where-unique-without-author.input.ts b/src/@generated/comment/comment-update-with-where-unique-without-author.input.ts index 50a0b2c1..e7bff005 100644 --- a/src/@generated/comment/comment-update-with-where-unique-without-author.input.ts +++ b/src/@generated/comment/comment-update-with-where-unique-without-author.input.ts @@ -9,11 +9,11 @@ export class CommentUpdateWithWhereUniqueWithoutAuthorInput { nullable: true, description: undefined, }) - where?: CommentWhereUniqueInput | null; + where?: CommentWhereUniqueInput; @Field(() => CommentUpdateWithoutAuthorDataInput, { nullable: true, description: undefined, }) - data?: CommentUpdateWithoutAuthorDataInput | null; + data?: CommentUpdateWithoutAuthorDataInput; } diff --git a/src/@generated/comment/comment-update-without-article-data.input.ts b/src/@generated/comment/comment-update-without-article-data.input.ts index 0bdb0a7a..9e2e19e3 100644 --- a/src/@generated/comment/comment-update-without-article-data.input.ts +++ b/src/@generated/comment/comment-update-without-article-data.input.ts @@ -8,29 +8,29 @@ export class CommentUpdateWithoutArticleDataInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - createdAt?: string | null; + createdAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - updatedAt?: string | null; + updatedAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - body?: string | null; + body?: string; @Field(() => UserUpdateOneRequiredWithoutCommentsInput, { nullable: true, description: undefined, }) - author?: UserUpdateOneRequiredWithoutCommentsInput | null; + author?: UserUpdateOneRequiredWithoutCommentsInput; } diff --git a/src/@generated/comment/comment-update-without-author-data.input.ts b/src/@generated/comment/comment-update-without-author-data.input.ts index ad8bcfe9..f7f4e7a3 100644 --- a/src/@generated/comment/comment-update-without-author-data.input.ts +++ b/src/@generated/comment/comment-update-without-author-data.input.ts @@ -8,25 +8,25 @@ export class CommentUpdateWithoutAuthorDataInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - createdAt?: string | null; + createdAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - updatedAt?: string | null; + updatedAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - body?: string | null; + body?: string; @Field(() => ArticleUpdateOneWithoutCommentsInput, { nullable: true, diff --git a/src/@generated/comment/comment-update.input.ts b/src/@generated/comment/comment-update.input.ts index d0d3df88..49d48557 100644 --- a/src/@generated/comment/comment-update.input.ts +++ b/src/@generated/comment/comment-update.input.ts @@ -9,31 +9,31 @@ export class CommentUpdateInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - createdAt?: string | null; + createdAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - updatedAt?: string | null; + updatedAt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - body?: string | null; + body?: string; @Field(() => UserUpdateOneRequiredWithoutCommentsInput, { nullable: true, description: undefined, }) - author?: UserUpdateOneRequiredWithoutCommentsInput | null; + author?: UserUpdateOneRequiredWithoutCommentsInput; @Field(() => ArticleUpdateOneWithoutCommentsInput, { nullable: true, diff --git a/src/@generated/comment/comment-upsert-with-where-unique-without-article.input.ts b/src/@generated/comment/comment-upsert-with-where-unique-without-article.input.ts index 9b80ad61..588a4ab4 100644 --- a/src/@generated/comment/comment-upsert-with-where-unique-without-article.input.ts +++ b/src/@generated/comment/comment-upsert-with-where-unique-without-article.input.ts @@ -10,17 +10,17 @@ export class CommentUpsertWithWhereUniqueWithoutArticleInput { nullable: true, description: undefined, }) - where?: CommentWhereUniqueInput | null; + where?: CommentWhereUniqueInput; @Field(() => CommentUpdateWithoutArticleDataInput, { nullable: true, description: undefined, }) - update?: CommentUpdateWithoutArticleDataInput | null; + update?: CommentUpdateWithoutArticleDataInput; @Field(() => CommentCreateWithoutArticleInput, { nullable: true, description: undefined, }) - create?: CommentCreateWithoutArticleInput | null; + create?: CommentCreateWithoutArticleInput; } diff --git a/src/@generated/comment/comment-upsert-with-where-unique-without-author.input.ts b/src/@generated/comment/comment-upsert-with-where-unique-without-author.input.ts index 0ab825d2..00ec888c 100644 --- a/src/@generated/comment/comment-upsert-with-where-unique-without-author.input.ts +++ b/src/@generated/comment/comment-upsert-with-where-unique-without-author.input.ts @@ -10,17 +10,17 @@ export class CommentUpsertWithWhereUniqueWithoutAuthorInput { nullable: true, description: undefined, }) - where?: CommentWhereUniqueInput | null; + where?: CommentWhereUniqueInput; @Field(() => CommentUpdateWithoutAuthorDataInput, { nullable: true, description: undefined, }) - update?: CommentUpdateWithoutAuthorDataInput | null; + update?: CommentUpdateWithoutAuthorDataInput; @Field(() => CommentCreateWithoutAuthorInput, { nullable: true, description: undefined, }) - create?: CommentCreateWithoutAuthorInput | null; + create?: CommentCreateWithoutAuthorInput; } diff --git a/src/@generated/comment/comment-where-unique.input.ts b/src/@generated/comment/comment-where-unique.input.ts index 196f6671..82e951a9 100644 --- a/src/@generated/comment/comment-where-unique.input.ts +++ b/src/@generated/comment/comment-where-unique.input.ts @@ -6,5 +6,5 @@ export class CommentWhereUniqueInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; } diff --git a/src/@generated/comment/comment-where.input.ts b/src/@generated/comment/comment-where.input.ts index 38bff5ae..c93b9525 100644 --- a/src/@generated/comment/comment-where.input.ts +++ b/src/@generated/comment/comment-where.input.ts @@ -12,31 +12,31 @@ export class CommentWhereInput { nullable: true, description: undefined, }) - id?: string | StringFilter | null; + id?: string | StringFilter; @Field(() => DateTimeFilter, { nullable: true, description: undefined, }) - createdAt?: string | DateTimeFilter | null; + createdAt?: Date | string | DateTimeFilter; @Field(() => DateTimeFilter, { nullable: true, description: undefined, }) - updatedAt?: string | DateTimeFilter | null; + updatedAt?: Date | string | DateTimeFilter; @Field(() => StringFilter, { nullable: true, description: undefined, }) - body?: string | StringFilter | null; + body?: string | StringFilter; @Field(() => StringFilter, { nullable: true, description: undefined, }) - authorId?: string | StringFilter | null; + authorId?: string | StringFilter; @Field(() => NullableStringFilter, { nullable: true, @@ -48,29 +48,29 @@ export class CommentWhereInput { nullable: true, description: undefined, }) - AND?: CommentWhereInput | CommentWhereInput[] | null; + AND?: CommentWhereInput | Array; @Field(() => [CommentWhereInput], { nullable: true, description: undefined, }) - OR?: CommentWhereInput | CommentWhereInput[] | null; + OR?: Array; @Field(() => [CommentWhereInput], { nullable: true, description: undefined, }) - NOT?: CommentWhereInput | CommentWhereInput[] | null; + NOT?: CommentWhereInput | Array; @Field(() => UserRelationFilter, { nullable: true, description: undefined, }) - author?: UserRelationFilter | UserRelationFilter[] | null; + author?: UserRelationFilter; @Field(() => ArticleRelationFilter, { nullable: true, description: undefined, }) - article?: ArticleRelationFilter | ArticleRelationFilter[] | null; + article?: ArticleRelationFilter | null; } diff --git a/src/@generated/comment/comment.model.ts b/src/@generated/comment/comment.model.ts index ac8200ef..87db43da 100644 --- a/src/@generated/comment/comment.model.ts +++ b/src/@generated/comment/comment.model.ts @@ -17,13 +17,13 @@ export class Comment { nullable: false, description: undefined, }) - createdAt!: string; + createdAt!: Date | string; @Field(() => String, { nullable: false, description: undefined, }) - updatedAt!: string; + updatedAt!: Date | string; @Field(() => String, { nullable: false, diff --git a/src/@generated/prisma/date-time-filter.input.ts b/src/@generated/prisma/date-time-filter.input.ts index c0421a36..5eb2889b 100644 --- a/src/@generated/prisma/date-time-filter.input.ts +++ b/src/@generated/prisma/date-time-filter.input.ts @@ -6,47 +6,47 @@ export class DateTimeFilter { nullable: true, description: undefined, }) - equals?: string | null; + equals?: Date | string; @Field(() => DateTimeFilter, { nullable: true, description: undefined, }) - not?: string | DateTimeFilter | null; + not?: Date | string | DateTimeFilter; @Field(() => [String], { nullable: true, description: undefined, }) - in?: string | string[] | null; + in?: Date | string | Array; @Field(() => [String], { nullable: true, description: undefined, }) - notIn?: string | string[] | null; + notIn?: Date | string | Array; @Field(() => String, { nullable: true, description: undefined, }) - lt?: string | null; + lt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - lte?: string | null; + lte?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - gt?: string | null; + gt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - gte?: string | null; + gte?: Date | string; } diff --git a/src/@generated/prisma/int-filter.input.ts b/src/@generated/prisma/int-filter.input.ts index 59b32f03..1a8c99ff 100644 --- a/src/@generated/prisma/int-filter.input.ts +++ b/src/@generated/prisma/int-filter.input.ts @@ -6,47 +6,47 @@ export class IntFilter { nullable: true, description: undefined, }) - equals?: number | null; + equals?: number; @Field(() => IntFilter, { nullable: true, description: undefined, }) - not?: number | IntFilter | null; + not?: number | IntFilter; @Field(() => [Int], { nullable: true, description: undefined, }) - in?: number | number[] | null; + in?: number | Array; @Field(() => [Int], { nullable: true, description: undefined, }) - notIn?: number | number[] | null; + notIn?: number | Array; @Field(() => Int, { nullable: true, description: undefined, }) - lt?: number | null; + lt?: number; @Field(() => Int, { nullable: true, description: undefined, }) - lte?: number | null; + lte?: number; @Field(() => Int, { nullable: true, description: undefined, }) - gt?: number | null; + gt?: number; @Field(() => Int, { nullable: true, description: undefined, }) - gte?: number | null; + gte?: number; } diff --git a/src/@generated/prisma/int-nullable-filter.input.ts b/src/@generated/prisma/int-nullable-filter.input.ts index 653fe818..76639c1b 100644 --- a/src/@generated/prisma/int-nullable-filter.input.ts +++ b/src/@generated/prisma/int-nullable-filter.input.ts @@ -14,7 +14,7 @@ export class IntNullableFilter { nullable: true, description: undefined, }) - in?: number | number[] | null; + in?: number | Array | null; @Field(() => Int, { nullable: true, diff --git a/src/@generated/prisma/nested-date-time-filter.input.ts b/src/@generated/prisma/nested-date-time-filter.input.ts index 68a3a2c5..325c6dc4 100644 --- a/src/@generated/prisma/nested-date-time-filter.input.ts +++ b/src/@generated/prisma/nested-date-time-filter.input.ts @@ -6,37 +6,37 @@ export class NestedDateTimeFilter { nullable: true, description: undefined, }) - equals?: string | null; + equals?: Date | string; @Field(() => [String], { nullable: true, description: undefined, }) - in?: string | string[] | null; + in?: Date | string | Array; @Field(() => String, { nullable: true, description: undefined, }) - lt?: string | null; + lt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - lte?: string | null; + lte?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - gt?: string | null; + gt?: Date | string; @Field(() => String, { nullable: true, description: undefined, }) - gte?: string | null; + gte?: Date | string; @Field(() => NestedDateTimeFilter, { nullable: true, diff --git a/src/@generated/prisma/nested-int-filter.input.ts b/src/@generated/prisma/nested-int-filter.input.ts index af080949..923f6e94 100644 --- a/src/@generated/prisma/nested-int-filter.input.ts +++ b/src/@generated/prisma/nested-int-filter.input.ts @@ -6,37 +6,37 @@ export class NestedIntFilter { nullable: true, description: undefined, }) - equals?: number | null; + equals?: number; @Field(() => [Int], { nullable: true, description: undefined, }) - in?: number | number[] | null; + in?: number | Array; @Field(() => Int, { nullable: true, description: undefined, }) - lt?: number | null; + lt?: number; @Field(() => Int, { nullable: true, description: undefined, }) - lte?: number | null; + lte?: number; @Field(() => Int, { nullable: true, description: undefined, }) - gt?: number | null; + gt?: number; @Field(() => Int, { nullable: true, description: undefined, }) - gte?: number | null; + gte?: number; @Field(() => NestedIntFilter, { nullable: true, diff --git a/src/@generated/prisma/nested-int-nullable-filter.input.ts b/src/@generated/prisma/nested-int-nullable-filter.input.ts index 69ef7406..842d2210 100644 --- a/src/@generated/prisma/nested-int-nullable-filter.input.ts +++ b/src/@generated/prisma/nested-int-nullable-filter.input.ts @@ -12,7 +12,7 @@ export class NestedIntNullableFilter { nullable: true, description: undefined, }) - in?: number | number[] | null; + in?: number | Array | null; @Field(() => Int, { nullable: true, diff --git a/src/@generated/prisma/nested-string-filter.input.ts b/src/@generated/prisma/nested-string-filter.input.ts index 0e222513..94c10988 100644 --- a/src/@generated/prisma/nested-string-filter.input.ts +++ b/src/@generated/prisma/nested-string-filter.input.ts @@ -6,55 +6,55 @@ export class NestedStringFilter { nullable: true, description: undefined, }) - equals?: string | null; + equals?: string; @Field(() => [String], { nullable: true, description: undefined, }) - in?: string | string[] | null; + in?: string | Array; @Field(() => String, { nullable: true, description: undefined, }) - lt?: string | null; + lt?: string; @Field(() => String, { nullable: true, description: undefined, }) - lte?: string | null; + lte?: string; @Field(() => String, { nullable: true, description: undefined, }) - gt?: string | null; + gt?: string; @Field(() => String, { nullable: true, description: undefined, }) - gte?: string | null; + gte?: string; @Field(() => String, { nullable: true, description: undefined, }) - contains?: string | null; + contains?: string; @Field(() => String, { nullable: true, description: undefined, }) - startsWith?: string | null; + startsWith?: string; @Field(() => String, { nullable: true, description: undefined, }) - endsWith?: string | null; + endsWith?: string; @Field(() => NestedStringFilter, { nullable: true, diff --git a/src/@generated/prisma/nested-string-nullable-filter.input.ts b/src/@generated/prisma/nested-string-nullable-filter.input.ts index 35499654..1b678f44 100644 --- a/src/@generated/prisma/nested-string-nullable-filter.input.ts +++ b/src/@generated/prisma/nested-string-nullable-filter.input.ts @@ -12,7 +12,7 @@ export class NestedStringNullableFilter { nullable: true, description: undefined, }) - in?: string | string[] | null; + in?: string | Array | null; @Field(() => String, { nullable: true, diff --git a/src/@generated/prisma/nullable-int-filter.input.ts b/src/@generated/prisma/nullable-int-filter.input.ts index a5f698bf..c151923f 100644 --- a/src/@generated/prisma/nullable-int-filter.input.ts +++ b/src/@generated/prisma/nullable-int-filter.input.ts @@ -18,13 +18,13 @@ export class NullableIntFilter { nullable: true, description: undefined, }) - in?: number | number[] | null; + in?: number | Array | null; @Field(() => [Int], { nullable: true, description: undefined, }) - notIn?: number | number[] | null; + notIn?: number | Array | null; @Field(() => Int, { nullable: true, diff --git a/src/@generated/prisma/nullable-string-filter.input.ts b/src/@generated/prisma/nullable-string-filter.input.ts index 7b844261..a5e56fd5 100644 --- a/src/@generated/prisma/nullable-string-filter.input.ts +++ b/src/@generated/prisma/nullable-string-filter.input.ts @@ -18,13 +18,13 @@ export class NullableStringFilter { nullable: true, description: undefined, }) - in?: string | string[] | null; + in?: string | Array | null; @Field(() => [String], { nullable: true, description: undefined, }) - notIn?: string | string[] | null; + notIn?: string | Array | null; @Field(() => String, { nullable: true, diff --git a/src/@generated/prisma/string-filter.input.ts b/src/@generated/prisma/string-filter.input.ts index 17d708a3..d7cefa15 100644 --- a/src/@generated/prisma/string-filter.input.ts +++ b/src/@generated/prisma/string-filter.input.ts @@ -6,65 +6,65 @@ export class StringFilter { nullable: true, description: undefined, }) - equals?: string | null; + equals?: string; @Field(() => StringFilter, { nullable: true, description: undefined, }) - not?: string | StringFilter | null; + not?: string | StringFilter; @Field(() => [String], { nullable: true, description: undefined, }) - in?: string | string[] | null; + in?: string | Array; @Field(() => [String], { nullable: true, description: undefined, }) - notIn?: string | string[] | null; + notIn?: string | Array; @Field(() => String, { nullable: true, description: undefined, }) - lt?: string | null; + lt?: string; @Field(() => String, { nullable: true, description: undefined, }) - lte?: string | null; + lte?: string; @Field(() => String, { nullable: true, description: undefined, }) - gt?: string | null; + gt?: string; @Field(() => String, { nullable: true, description: undefined, }) - gte?: string | null; + gte?: string; @Field(() => String, { nullable: true, description: undefined, }) - contains?: string | null; + contains?: string; @Field(() => String, { nullable: true, description: undefined, }) - startsWith?: string | null; + startsWith?: string; @Field(() => String, { nullable: true, description: undefined, }) - endsWith?: string | null; + endsWith?: string; } diff --git a/src/@generated/prisma/string-nullable-filter.input.ts b/src/@generated/prisma/string-nullable-filter.input.ts index ba004393..8c3791a2 100644 --- a/src/@generated/prisma/string-nullable-filter.input.ts +++ b/src/@generated/prisma/string-nullable-filter.input.ts @@ -14,7 +14,7 @@ export class StringNullableFilter { nullable: true, description: undefined, }) - in?: string | string[] | null; + in?: string | Array | null; @Field(() => String, { nullable: true, diff --git a/src/@generated/tag/tag-create-many-without-articles.input.ts b/src/@generated/tag/tag-create-many-without-articles.input.ts index cbb1d34d..4e62979d 100644 --- a/src/@generated/tag/tag-create-many-without-articles.input.ts +++ b/src/@generated/tag/tag-create-many-without-articles.input.ts @@ -9,11 +9,11 @@ export class TagCreateManyWithoutArticlesInput { nullable: true, description: undefined, }) - create?: TagCreateWithoutArticlesInput | TagCreateWithoutArticlesInput[] | null; + create?: Array; @Field(() => [TagWhereUniqueInput], { nullable: true, description: undefined, }) - connect?: TagWhereUniqueInput | TagWhereUniqueInput[] | null; + connect?: Array; } diff --git a/src/@generated/tag/tag-create-without-articles.input.ts b/src/@generated/tag/tag-create-without-articles.input.ts index 7be4a8c7..103f7143 100644 --- a/src/@generated/tag/tag-create-without-articles.input.ts +++ b/src/@generated/tag/tag-create-without-articles.input.ts @@ -6,11 +6,11 @@ export class TagCreateWithoutArticlesInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - name?: string | null; + name?: string; } diff --git a/src/@generated/tag/tag-create.input.ts b/src/@generated/tag/tag-create.input.ts index 6a9cfd37..0e48ffd8 100644 --- a/src/@generated/tag/tag-create.input.ts +++ b/src/@generated/tag/tag-create.input.ts @@ -8,13 +8,13 @@ export class TagCreateInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - name?: string | null; + name?: string; @Field(() => ArticleCreateManyWithoutTagsInput, { nullable: true, diff --git a/src/@generated/tag/tag-filter.input.ts b/src/@generated/tag/tag-filter.input.ts index 9f8b1a3b..381dcd32 100644 --- a/src/@generated/tag/tag-filter.input.ts +++ b/src/@generated/tag/tag-filter.input.ts @@ -8,17 +8,17 @@ export class TagFilter { nullable: true, description: undefined, }) - every?: TagWhereInput | TagWhereInput[] | null; + every?: TagWhereInput; @Field(() => TagWhereInput, { nullable: true, description: undefined, }) - some?: TagWhereInput | TagWhereInput[] | null; + some?: TagWhereInput; @Field(() => TagWhereInput, { nullable: true, description: undefined, }) - none?: TagWhereInput | TagWhereInput[] | null; + none?: TagWhereInput; } diff --git a/src/@generated/tag/tag-list-relation-filter.input.ts b/src/@generated/tag/tag-list-relation-filter.input.ts index 9835a418..e7e12079 100644 --- a/src/@generated/tag/tag-list-relation-filter.input.ts +++ b/src/@generated/tag/tag-list-relation-filter.input.ts @@ -8,17 +8,17 @@ export class TagListRelationFilter { nullable: true, description: undefined, }) - every?: TagWhereInput | null; + every?: TagWhereInput; @Field(() => TagWhereInput, { nullable: true, description: undefined, }) - some?: TagWhereInput | null; + some?: TagWhereInput; @Field(() => TagWhereInput, { nullable: true, description: undefined, }) - none?: TagWhereInput | null; + none?: TagWhereInput; } diff --git a/src/@generated/tag/tag-order-by.input.ts b/src/@generated/tag/tag-order-by.input.ts index 0af44934..074d570e 100644 --- a/src/@generated/tag/tag-order-by.input.ts +++ b/src/@generated/tag/tag-order-by.input.ts @@ -8,11 +8,11 @@ export class TagOrderByInput { nullable: true, description: undefined, }) - id?: SortOrder | null; + id?: SortOrder; @Field(() => SortOrder, { nullable: true, description: undefined, }) - name?: SortOrder | null; + name?: SortOrder; } diff --git a/src/@generated/tag/tag-scalar-where.input.ts b/src/@generated/tag/tag-scalar-where.input.ts index d1f9a0b9..4ec1304e 100644 --- a/src/@generated/tag/tag-scalar-where.input.ts +++ b/src/@generated/tag/tag-scalar-where.input.ts @@ -9,13 +9,13 @@ export class TagScalarWhereInput { nullable: true, description: undefined, }) - id?: string | StringFilter | null; + id?: string | StringFilter; @Field(() => StringFilter, { nullable: true, description: undefined, }) - name?: string | StringFilter | null; + name?: string | StringFilter; @Field(() => ArticleFilter, { nullable: true, @@ -27,17 +27,17 @@ export class TagScalarWhereInput { nullable: true, description: undefined, }) - AND?: TagScalarWhereInput | TagScalarWhereInput[] | null; + AND?: TagScalarWhereInput | Array; @Field(() => [TagScalarWhereInput], { nullable: true, description: undefined, }) - OR?: TagScalarWhereInput | TagScalarWhereInput[] | null; + OR?: Array; @Field(() => [TagScalarWhereInput], { nullable: true, description: undefined, }) - NOT?: TagScalarWhereInput | TagScalarWhereInput[] | null; + NOT?: TagScalarWhereInput | Array; } diff --git a/src/@generated/tag/tag-update-many-data.input.ts b/src/@generated/tag/tag-update-many-data.input.ts index c85349d7..2f3df7b9 100644 --- a/src/@generated/tag/tag-update-many-data.input.ts +++ b/src/@generated/tag/tag-update-many-data.input.ts @@ -6,11 +6,11 @@ export class TagUpdateManyDataInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - name?: string | null; + name?: string; } diff --git a/src/@generated/tag/tag-update-many-mutation.input.ts b/src/@generated/tag/tag-update-many-mutation.input.ts index b91ecf5b..bf2c2dba 100644 --- a/src/@generated/tag/tag-update-many-mutation.input.ts +++ b/src/@generated/tag/tag-update-many-mutation.input.ts @@ -6,11 +6,11 @@ export class TagUpdateManyMutationInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - name?: string | null; + name?: string; } diff --git a/src/@generated/tag/tag-update-many-with-where-nested.input.ts b/src/@generated/tag/tag-update-many-with-where-nested.input.ts index 4d63ff31..5882718a 100644 --- a/src/@generated/tag/tag-update-many-with-where-nested.input.ts +++ b/src/@generated/tag/tag-update-many-with-where-nested.input.ts @@ -9,11 +9,11 @@ export class TagUpdateManyWithWhereNestedInput { nullable: true, description: undefined, }) - where?: TagScalarWhereInput | null; + where?: TagScalarWhereInput; @Field(() => TagUpdateManyDataInput, { nullable: true, description: undefined, }) - data?: TagUpdateManyDataInput | null; + data?: TagUpdateManyDataInput; } diff --git a/src/@generated/tag/tag-update-many-without-articles.input.ts b/src/@generated/tag/tag-update-many-without-articles.input.ts index c9fa2b9a..cd790c01 100644 --- a/src/@generated/tag/tag-update-many-without-articles.input.ts +++ b/src/@generated/tag/tag-update-many-without-articles.input.ts @@ -13,59 +13,53 @@ export class TagUpdateManyWithoutArticlesInput { nullable: true, description: undefined, }) - create?: TagCreateWithoutArticlesInput | TagCreateWithoutArticlesInput[] | null; + create?: Array; @Field(() => [TagWhereUniqueInput], { nullable: true, description: undefined, }) - connect?: TagWhereUniqueInput | TagWhereUniqueInput[] | null; + connect?: Array; @Field(() => [TagWhereUniqueInput], { nullable: true, description: undefined, }) - set?: TagWhereUniqueInput | TagWhereUniqueInput[] | null; + set?: Array; @Field(() => [TagWhereUniqueInput], { nullable: true, description: undefined, }) - disconnect?: TagWhereUniqueInput | TagWhereUniqueInput[] | null; + disconnect?: Array; @Field(() => [TagWhereUniqueInput], { nullable: true, description: undefined, }) - delete?: TagWhereUniqueInput | TagWhereUniqueInput[] | null; + delete?: Array; @Field(() => [TagUpdateWithWhereUniqueWithoutArticlesInput], { nullable: true, description: undefined, }) - update?: - | TagUpdateWithWhereUniqueWithoutArticlesInput - | TagUpdateWithWhereUniqueWithoutArticlesInput[] - | null; + update?: Array; @Field(() => [TagUpdateManyWithWhereNestedInput], { nullable: true, description: undefined, }) - updateMany?: TagUpdateManyWithWhereNestedInput | TagUpdateManyWithWhereNestedInput[] | null; + updateMany?: Array | null; @Field(() => [TagScalarWhereInput], { nullable: true, description: undefined, }) - deleteMany?: TagScalarWhereInput | TagScalarWhereInput[] | null; + deleteMany?: Array; @Field(() => [TagUpsertWithWhereUniqueWithoutArticlesInput], { nullable: true, description: undefined, }) - upsert?: - | TagUpsertWithWhereUniqueWithoutArticlesInput - | TagUpsertWithWhereUniqueWithoutArticlesInput[] - | null; + upsert?: Array; } diff --git a/src/@generated/tag/tag-update-with-where-unique-without-articles.input.ts b/src/@generated/tag/tag-update-with-where-unique-without-articles.input.ts index 8c9006b6..917e0f1e 100644 --- a/src/@generated/tag/tag-update-with-where-unique-without-articles.input.ts +++ b/src/@generated/tag/tag-update-with-where-unique-without-articles.input.ts @@ -9,11 +9,11 @@ export class TagUpdateWithWhereUniqueWithoutArticlesInput { nullable: true, description: undefined, }) - where?: TagWhereUniqueInput | null; + where?: TagWhereUniqueInput; @Field(() => TagUpdateWithoutArticlesDataInput, { nullable: true, description: undefined, }) - data?: TagUpdateWithoutArticlesDataInput | null; + data?: TagUpdateWithoutArticlesDataInput; } diff --git a/src/@generated/tag/tag-update-without-articles-data.input.ts b/src/@generated/tag/tag-update-without-articles-data.input.ts index faed86aa..337c9405 100644 --- a/src/@generated/tag/tag-update-without-articles-data.input.ts +++ b/src/@generated/tag/tag-update-without-articles-data.input.ts @@ -6,11 +6,11 @@ export class TagUpdateWithoutArticlesDataInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - name?: string | null; + name?: string; } diff --git a/src/@generated/tag/tag-update.input.ts b/src/@generated/tag/tag-update.input.ts index 0c9c9fad..47448a30 100644 --- a/src/@generated/tag/tag-update.input.ts +++ b/src/@generated/tag/tag-update.input.ts @@ -8,13 +8,13 @@ export class TagUpdateInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - name?: string | null; + name?: string; @Field(() => ArticleUpdateManyWithoutTagsInput, { nullable: true, diff --git a/src/@generated/tag/tag-upsert-with-where-unique-without-articles.input.ts b/src/@generated/tag/tag-upsert-with-where-unique-without-articles.input.ts index 77ea8d57..31e83e60 100644 --- a/src/@generated/tag/tag-upsert-with-where-unique-without-articles.input.ts +++ b/src/@generated/tag/tag-upsert-with-where-unique-without-articles.input.ts @@ -10,17 +10,17 @@ export class TagUpsertWithWhereUniqueWithoutArticlesInput { nullable: true, description: undefined, }) - where?: TagWhereUniqueInput | null; + where?: TagWhereUniqueInput; @Field(() => TagUpdateWithoutArticlesDataInput, { nullable: true, description: undefined, }) - update?: TagUpdateWithoutArticlesDataInput | null; + update?: TagUpdateWithoutArticlesDataInput; @Field(() => TagCreateWithoutArticlesInput, { nullable: true, description: undefined, }) - create?: TagCreateWithoutArticlesInput | null; + create?: TagCreateWithoutArticlesInput; } diff --git a/src/@generated/tag/tag-where-unique.input.ts b/src/@generated/tag/tag-where-unique.input.ts index 5b68dd80..1de7d2d4 100644 --- a/src/@generated/tag/tag-where-unique.input.ts +++ b/src/@generated/tag/tag-where-unique.input.ts @@ -6,11 +6,11 @@ export class TagWhereUniqueInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - name?: string | null; + name?: string; } diff --git a/src/@generated/tag/tag-where.input.ts b/src/@generated/tag/tag-where.input.ts index edb295f4..8c4d2a9f 100644 --- a/src/@generated/tag/tag-where.input.ts +++ b/src/@generated/tag/tag-where.input.ts @@ -9,13 +9,13 @@ export class TagWhereInput { nullable: true, description: undefined, }) - id?: string | StringFilter | null; + id?: string | StringFilter; @Field(() => StringFilter, { nullable: true, description: undefined, }) - name?: string | StringFilter | null; + name?: string | StringFilter; @Field(() => ArticleFilter, { nullable: true, @@ -27,17 +27,17 @@ export class TagWhereInput { nullable: true, description: undefined, }) - AND?: TagWhereInput | TagWhereInput[] | null; + AND?: TagWhereInput | Array; @Field(() => [TagWhereInput], { nullable: true, description: undefined, }) - OR?: TagWhereInput | TagWhereInput[] | null; + OR?: Array; @Field(() => [TagWhereInput], { nullable: true, description: undefined, }) - NOT?: TagWhereInput | TagWhereInput[] | null; + NOT?: TagWhereInput | Array; } diff --git a/src/@generated/user/user-create-many-without-favorite-articles.input.ts b/src/@generated/user/user-create-many-without-favorite-articles.input.ts index dc0747b5..8961fb63 100644 --- a/src/@generated/user/user-create-many-without-favorite-articles.input.ts +++ b/src/@generated/user/user-create-many-without-favorite-articles.input.ts @@ -9,14 +9,11 @@ export class UserCreateManyWithoutFavoriteArticlesInput { nullable: true, description: undefined, }) - create?: - | UserCreateWithoutFavoriteArticlesInput - | UserCreateWithoutFavoriteArticlesInput[] - | null; + create?: Array; @Field(() => [UserWhereUniqueInput], { nullable: true, description: undefined, }) - connect?: UserWhereUniqueInput | UserWhereUniqueInput[] | null; + connect?: Array; } diff --git a/src/@generated/user/user-create-many-without-followers.input.ts b/src/@generated/user/user-create-many-without-followers.input.ts index 24fac071..6dd1abf1 100644 --- a/src/@generated/user/user-create-many-without-followers.input.ts +++ b/src/@generated/user/user-create-many-without-followers.input.ts @@ -9,11 +9,11 @@ export class UserCreateManyWithoutFollowersInput { nullable: true, description: undefined, }) - create?: UserCreateWithoutFollowersInput | UserCreateWithoutFollowersInput[] | null; + create?: Array; @Field(() => [UserWhereUniqueInput], { nullable: true, description: undefined, }) - connect?: UserWhereUniqueInput | UserWhereUniqueInput[] | null; + connect?: Array; } diff --git a/src/@generated/user/user-create-many-without-following.input.ts b/src/@generated/user/user-create-many-without-following.input.ts index c835254e..793638ae 100644 --- a/src/@generated/user/user-create-many-without-following.input.ts +++ b/src/@generated/user/user-create-many-without-following.input.ts @@ -9,11 +9,11 @@ export class UserCreateManyWithoutFollowingInput { nullable: true, description: undefined, }) - create?: UserCreateWithoutFollowingInput | UserCreateWithoutFollowingInput[] | null; + create?: Array; @Field(() => [UserWhereUniqueInput], { nullable: true, description: undefined, }) - connect?: UserWhereUniqueInput | UserWhereUniqueInput[] | null; + connect?: Array; } diff --git a/src/@generated/user/user-create-one-without-articles.input.ts b/src/@generated/user/user-create-one-without-articles.input.ts index 123aede0..d3f7da64 100644 --- a/src/@generated/user/user-create-one-without-articles.input.ts +++ b/src/@generated/user/user-create-one-without-articles.input.ts @@ -9,11 +9,11 @@ export class UserCreateOneWithoutArticlesInput { nullable: true, description: undefined, }) - create?: UserCreateWithoutArticlesInput | null; + create?: UserCreateWithoutArticlesInput; @Field(() => UserWhereUniqueInput, { nullable: true, description: undefined, }) - connect?: UserWhereUniqueInput | null; + connect?: UserWhereUniqueInput; } diff --git a/src/@generated/user/user-create-one-without-comments.input.ts b/src/@generated/user/user-create-one-without-comments.input.ts index 9c3c538c..47efaba0 100644 --- a/src/@generated/user/user-create-one-without-comments.input.ts +++ b/src/@generated/user/user-create-one-without-comments.input.ts @@ -9,11 +9,11 @@ export class UserCreateOneWithoutCommentsInput { nullable: true, description: undefined, }) - create?: UserCreateWithoutCommentsInput | null; + create?: UserCreateWithoutCommentsInput; @Field(() => UserWhereUniqueInput, { nullable: true, description: undefined, }) - connect?: UserWhereUniqueInput | null; + connect?: UserWhereUniqueInput; } diff --git a/src/@generated/user/user-create-without-articles.input.ts b/src/@generated/user/user-create-without-articles.input.ts index 7529a44d..98d6ba5f 100644 --- a/src/@generated/user/user-create-without-articles.input.ts +++ b/src/@generated/user/user-create-without-articles.input.ts @@ -11,25 +11,25 @@ export class UserCreateWithoutArticlesInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - email?: string | null; + email?: string; @Field(() => String, { nullable: true, description: undefined, }) - name?: string | null; + name?: string; @Field(() => String, { nullable: true, description: undefined, }) - password?: string | null; + password?: string; @Field(() => String, { nullable: true, diff --git a/src/@generated/user/user-create-without-comments.input.ts b/src/@generated/user/user-create-without-comments.input.ts index 043790b3..51114d1d 100644 --- a/src/@generated/user/user-create-without-comments.input.ts +++ b/src/@generated/user/user-create-without-comments.input.ts @@ -11,25 +11,25 @@ export class UserCreateWithoutCommentsInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - email?: string | null; + email?: string; @Field(() => String, { nullable: true, description: undefined, }) - name?: string | null; + name?: string; @Field(() => String, { nullable: true, description: undefined, }) - password?: string | null; + password?: string; @Field(() => String, { nullable: true, diff --git a/src/@generated/user/user-create-without-favorite-articles.input.ts b/src/@generated/user/user-create-without-favorite-articles.input.ts index e0ccb6f3..1c499579 100644 --- a/src/@generated/user/user-create-without-favorite-articles.input.ts +++ b/src/@generated/user/user-create-without-favorite-articles.input.ts @@ -11,25 +11,25 @@ export class UserCreateWithoutFavoriteArticlesInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - email?: string | null; + email?: string; @Field(() => String, { nullable: true, description: undefined, }) - name?: string | null; + name?: string; @Field(() => String, { nullable: true, description: undefined, }) - password?: string | null; + password?: string; @Field(() => String, { nullable: true, diff --git a/src/@generated/user/user-create-without-followers.input.ts b/src/@generated/user/user-create-without-followers.input.ts index ff0c6405..bbf911a5 100644 --- a/src/@generated/user/user-create-without-followers.input.ts +++ b/src/@generated/user/user-create-without-followers.input.ts @@ -11,25 +11,25 @@ export class UserCreateWithoutFollowersInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - email?: string | null; + email?: string; @Field(() => String, { nullable: true, description: undefined, }) - name?: string | null; + name?: string; @Field(() => String, { nullable: true, description: undefined, }) - password?: string | null; + password?: string; @Field(() => String, { nullable: true, diff --git a/src/@generated/user/user-create-without-following.input.ts b/src/@generated/user/user-create-without-following.input.ts index 8ad91314..a6e883e6 100644 --- a/src/@generated/user/user-create-without-following.input.ts +++ b/src/@generated/user/user-create-without-following.input.ts @@ -11,25 +11,25 @@ export class UserCreateWithoutFollowingInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - email?: string | null; + email?: string; @Field(() => String, { nullable: true, description: undefined, }) - name?: string | null; + name?: string; @Field(() => String, { nullable: true, description: undefined, }) - password?: string | null; + password?: string; @Field(() => String, { nullable: true, diff --git a/src/@generated/user/user-create.input.ts b/src/@generated/user/user-create.input.ts index 4f04966e..3af8a8ee 100644 --- a/src/@generated/user/user-create.input.ts +++ b/src/@generated/user/user-create.input.ts @@ -12,25 +12,25 @@ export class UserCreateInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - email?: string | null; + email?: string; @Field(() => String, { nullable: true, description: undefined, }) - name?: string | null; + name?: string; @Field(() => String, { nullable: true, description: undefined, }) - password?: string | null; + password?: string; @Field(() => String, { nullable: true, diff --git a/src/@generated/user/user-filter.input.ts b/src/@generated/user/user-filter.input.ts index 151ab052..62207c2a 100644 --- a/src/@generated/user/user-filter.input.ts +++ b/src/@generated/user/user-filter.input.ts @@ -8,17 +8,17 @@ export class UserFilter { nullable: true, description: undefined, }) - every?: UserWhereInput | UserWhereInput[] | null; + every?: UserWhereInput; @Field(() => UserWhereInput, { nullable: true, description: undefined, }) - some?: UserWhereInput | UserWhereInput[] | null; + some?: UserWhereInput; @Field(() => UserWhereInput, { nullable: true, description: undefined, }) - none?: UserWhereInput | UserWhereInput[] | null; + none?: UserWhereInput; } diff --git a/src/@generated/user/user-list-relation-filter.input.ts b/src/@generated/user/user-list-relation-filter.input.ts index d4b91ae0..7ba72bf0 100644 --- a/src/@generated/user/user-list-relation-filter.input.ts +++ b/src/@generated/user/user-list-relation-filter.input.ts @@ -8,17 +8,17 @@ export class UserListRelationFilter { nullable: true, description: undefined, }) - every?: UserWhereInput | null; + every?: UserWhereInput; @Field(() => UserWhereInput, { nullable: true, description: undefined, }) - some?: UserWhereInput | null; + some?: UserWhereInput; @Field(() => UserWhereInput, { nullable: true, description: undefined, }) - none?: UserWhereInput | null; + none?: UserWhereInput; } diff --git a/src/@generated/user/user-order-by.input.ts b/src/@generated/user/user-order-by.input.ts index b6b1b0e1..948debee 100644 --- a/src/@generated/user/user-order-by.input.ts +++ b/src/@generated/user/user-order-by.input.ts @@ -8,25 +8,25 @@ export class UserOrderByInput { nullable: true, description: undefined, }) - id?: SortOrder | null; + id?: SortOrder; @Field(() => SortOrder, { nullable: true, description: undefined, }) - email?: SortOrder | null; + email?: SortOrder; @Field(() => SortOrder, { nullable: true, description: undefined, }) - name?: SortOrder | null; + name?: SortOrder; @Field(() => SortOrder, { nullable: true, description: undefined, }) - password?: SortOrder | null; + password?: SortOrder; @Field(() => SortOrder, { nullable: true, diff --git a/src/@generated/user/user-scalar-where.input.ts b/src/@generated/user/user-scalar-where.input.ts index 460fdcd9..797370cc 100644 --- a/src/@generated/user/user-scalar-where.input.ts +++ b/src/@generated/user/user-scalar-where.input.ts @@ -13,25 +13,25 @@ export class UserScalarWhereInput { nullable: true, description: undefined, }) - id?: string | StringFilter | null; + id?: string | StringFilter; @Field(() => StringFilter, { nullable: true, description: undefined, }) - email?: string | StringFilter | null; + email?: string | StringFilter; @Field(() => StringFilter, { nullable: true, description: undefined, }) - name?: string | StringFilter | null; + name?: string | StringFilter; @Field(() => StringFilter, { nullable: true, description: undefined, }) - password?: string | StringFilter | null; + password?: string | StringFilter; @Field(() => NullableStringFilter, { nullable: true, @@ -85,17 +85,17 @@ export class UserScalarWhereInput { nullable: true, description: undefined, }) - AND?: UserScalarWhereInput | UserScalarWhereInput[] | null; + AND?: UserScalarWhereInput | Array; @Field(() => [UserScalarWhereInput], { nullable: true, description: undefined, }) - OR?: UserScalarWhereInput | UserScalarWhereInput[] | null; + OR?: Array; @Field(() => [UserScalarWhereInput], { nullable: true, description: undefined, }) - NOT?: UserScalarWhereInput | UserScalarWhereInput[] | null; + NOT?: UserScalarWhereInput | Array; } diff --git a/src/@generated/user/user-update-many-data.input.ts b/src/@generated/user/user-update-many-data.input.ts index 2d93f3b4..d595c8e4 100644 --- a/src/@generated/user/user-update-many-data.input.ts +++ b/src/@generated/user/user-update-many-data.input.ts @@ -6,25 +6,25 @@ export class UserUpdateManyDataInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - email?: string | null; + email?: string; @Field(() => String, { nullable: true, description: undefined, }) - name?: string | null; + name?: string; @Field(() => String, { nullable: true, description: undefined, }) - password?: string | null; + password?: string; @Field(() => String, { nullable: true, diff --git a/src/@generated/user/user-update-many-mutation.input.ts b/src/@generated/user/user-update-many-mutation.input.ts index 217f3a18..4407249c 100644 --- a/src/@generated/user/user-update-many-mutation.input.ts +++ b/src/@generated/user/user-update-many-mutation.input.ts @@ -6,25 +6,25 @@ export class UserUpdateManyMutationInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - email?: string | null; + email?: string; @Field(() => String, { nullable: true, description: undefined, }) - name?: string | null; + name?: string; @Field(() => String, { nullable: true, description: undefined, }) - password?: string | null; + password?: string; @Field(() => String, { nullable: true, diff --git a/src/@generated/user/user-update-many-with-where-nested.input.ts b/src/@generated/user/user-update-many-with-where-nested.input.ts index a87ddbcd..81c4249d 100644 --- a/src/@generated/user/user-update-many-with-where-nested.input.ts +++ b/src/@generated/user/user-update-many-with-where-nested.input.ts @@ -9,11 +9,11 @@ export class UserUpdateManyWithWhereNestedInput { nullable: true, description: undefined, }) - where?: UserScalarWhereInput | null; + where?: UserScalarWhereInput; @Field(() => UserUpdateManyDataInput, { nullable: true, description: undefined, }) - data?: UserUpdateManyDataInput | null; + data?: UserUpdateManyDataInput; } diff --git a/src/@generated/user/user-update-many-without-favorite-articles.input.ts b/src/@generated/user/user-update-many-without-favorite-articles.input.ts index cd0bade6..5c729ac3 100644 --- a/src/@generated/user/user-update-many-without-favorite-articles.input.ts +++ b/src/@generated/user/user-update-many-without-favorite-articles.input.ts @@ -13,62 +13,53 @@ export class UserUpdateManyWithoutFavoriteArticlesInput { nullable: true, description: undefined, }) - create?: - | UserCreateWithoutFavoriteArticlesInput - | UserCreateWithoutFavoriteArticlesInput[] - | null; + create?: Array; @Field(() => [UserWhereUniqueInput], { nullable: true, description: undefined, }) - connect?: UserWhereUniqueInput | UserWhereUniqueInput[] | null; + connect?: Array; @Field(() => [UserWhereUniqueInput], { nullable: true, description: undefined, }) - set?: UserWhereUniqueInput | UserWhereUniqueInput[] | null; + set?: Array; @Field(() => [UserWhereUniqueInput], { nullable: true, description: undefined, }) - disconnect?: UserWhereUniqueInput | UserWhereUniqueInput[] | null; + disconnect?: Array; @Field(() => [UserWhereUniqueInput], { nullable: true, description: undefined, }) - delete?: UserWhereUniqueInput | UserWhereUniqueInput[] | null; + delete?: Array; @Field(() => [UserUpdateWithWhereUniqueWithoutFavoriteArticlesInput], { nullable: true, description: undefined, }) - update?: - | UserUpdateWithWhereUniqueWithoutFavoriteArticlesInput - | UserUpdateWithWhereUniqueWithoutFavoriteArticlesInput[] - | null; + update?: Array; @Field(() => [UserUpdateManyWithWhereNestedInput], { nullable: true, description: undefined, }) - updateMany?: UserUpdateManyWithWhereNestedInput | UserUpdateManyWithWhereNestedInput[] | null; + updateMany?: Array | null; @Field(() => [UserScalarWhereInput], { nullable: true, description: undefined, }) - deleteMany?: UserScalarWhereInput | UserScalarWhereInput[] | null; + deleteMany?: Array; @Field(() => [UserUpsertWithWhereUniqueWithoutFavoriteArticlesInput], { nullable: true, description: undefined, }) - upsert?: - | UserUpsertWithWhereUniqueWithoutFavoriteArticlesInput - | UserUpsertWithWhereUniqueWithoutFavoriteArticlesInput[] - | null; + upsert?: Array; } diff --git a/src/@generated/user/user-update-many-without-followers.input.ts b/src/@generated/user/user-update-many-without-followers.input.ts index 3d13237d..aaf11143 100644 --- a/src/@generated/user/user-update-many-without-followers.input.ts +++ b/src/@generated/user/user-update-many-without-followers.input.ts @@ -13,59 +13,53 @@ export class UserUpdateManyWithoutFollowersInput { nullable: true, description: undefined, }) - create?: UserCreateWithoutFollowersInput | UserCreateWithoutFollowersInput[] | null; + create?: Array; @Field(() => [UserWhereUniqueInput], { nullable: true, description: undefined, }) - connect?: UserWhereUniqueInput | UserWhereUniqueInput[] | null; + connect?: Array; @Field(() => [UserWhereUniqueInput], { nullable: true, description: undefined, }) - set?: UserWhereUniqueInput | UserWhereUniqueInput[] | null; + set?: Array; @Field(() => [UserWhereUniqueInput], { nullable: true, description: undefined, }) - disconnect?: UserWhereUniqueInput | UserWhereUniqueInput[] | null; + disconnect?: Array; @Field(() => [UserWhereUniqueInput], { nullable: true, description: undefined, }) - delete?: UserWhereUniqueInput | UserWhereUniqueInput[] | null; + delete?: Array; @Field(() => [UserUpdateWithWhereUniqueWithoutFollowersInput], { nullable: true, description: undefined, }) - update?: - | UserUpdateWithWhereUniqueWithoutFollowersInput - | UserUpdateWithWhereUniqueWithoutFollowersInput[] - | null; + update?: Array; @Field(() => [UserUpdateManyWithWhereNestedInput], { nullable: true, description: undefined, }) - updateMany?: UserUpdateManyWithWhereNestedInput | UserUpdateManyWithWhereNestedInput[] | null; + updateMany?: Array | null; @Field(() => [UserScalarWhereInput], { nullable: true, description: undefined, }) - deleteMany?: UserScalarWhereInput | UserScalarWhereInput[] | null; + deleteMany?: Array; @Field(() => [UserUpsertWithWhereUniqueWithoutFollowersInput], { nullable: true, description: undefined, }) - upsert?: - | UserUpsertWithWhereUniqueWithoutFollowersInput - | UserUpsertWithWhereUniqueWithoutFollowersInput[] - | null; + upsert?: Array; } diff --git a/src/@generated/user/user-update-many-without-following.input.ts b/src/@generated/user/user-update-many-without-following.input.ts index 4a2f736b..8cd8735c 100644 --- a/src/@generated/user/user-update-many-without-following.input.ts +++ b/src/@generated/user/user-update-many-without-following.input.ts @@ -13,59 +13,53 @@ export class UserUpdateManyWithoutFollowingInput { nullable: true, description: undefined, }) - create?: UserCreateWithoutFollowingInput | UserCreateWithoutFollowingInput[] | null; + create?: Array; @Field(() => [UserWhereUniqueInput], { nullable: true, description: undefined, }) - connect?: UserWhereUniqueInput | UserWhereUniqueInput[] | null; + connect?: Array; @Field(() => [UserWhereUniqueInput], { nullable: true, description: undefined, }) - set?: UserWhereUniqueInput | UserWhereUniqueInput[] | null; + set?: Array; @Field(() => [UserWhereUniqueInput], { nullable: true, description: undefined, }) - disconnect?: UserWhereUniqueInput | UserWhereUniqueInput[] | null; + disconnect?: Array; @Field(() => [UserWhereUniqueInput], { nullable: true, description: undefined, }) - delete?: UserWhereUniqueInput | UserWhereUniqueInput[] | null; + delete?: Array; @Field(() => [UserUpdateWithWhereUniqueWithoutFollowingInput], { nullable: true, description: undefined, }) - update?: - | UserUpdateWithWhereUniqueWithoutFollowingInput - | UserUpdateWithWhereUniqueWithoutFollowingInput[] - | null; + update?: Array; @Field(() => [UserUpdateManyWithWhereNestedInput], { nullable: true, description: undefined, }) - updateMany?: UserUpdateManyWithWhereNestedInput | UserUpdateManyWithWhereNestedInput[] | null; + updateMany?: Array | null; @Field(() => [UserScalarWhereInput], { nullable: true, description: undefined, }) - deleteMany?: UserScalarWhereInput | UserScalarWhereInput[] | null; + deleteMany?: Array; @Field(() => [UserUpsertWithWhereUniqueWithoutFollowingInput], { nullable: true, description: undefined, }) - upsert?: - | UserUpsertWithWhereUniqueWithoutFollowingInput - | UserUpsertWithWhereUniqueWithoutFollowingInput[] - | null; + upsert?: Array; } diff --git a/src/@generated/user/user-update-one-required-without-articles.input.ts b/src/@generated/user/user-update-one-required-without-articles.input.ts index c4ae67bf..54cae63e 100644 --- a/src/@generated/user/user-update-one-required-without-articles.input.ts +++ b/src/@generated/user/user-update-one-required-without-articles.input.ts @@ -11,23 +11,23 @@ export class UserUpdateOneRequiredWithoutArticlesInput { nullable: true, description: undefined, }) - create?: UserCreateWithoutArticlesInput | null; + create?: UserCreateWithoutArticlesInput; @Field(() => UserWhereUniqueInput, { nullable: true, description: undefined, }) - connect?: UserWhereUniqueInput | null; + connect?: UserWhereUniqueInput; @Field(() => UserUpdateWithoutArticlesDataInput, { nullable: true, description: undefined, }) - update?: UserUpdateWithoutArticlesDataInput | null; + update?: UserUpdateWithoutArticlesDataInput; @Field(() => UserUpsertWithoutArticlesInput, { nullable: true, description: undefined, }) - upsert?: UserUpsertWithoutArticlesInput | null; + upsert?: UserUpsertWithoutArticlesInput; } diff --git a/src/@generated/user/user-update-one-required-without-comments.input.ts b/src/@generated/user/user-update-one-required-without-comments.input.ts index 67d45a42..075b36f4 100644 --- a/src/@generated/user/user-update-one-required-without-comments.input.ts +++ b/src/@generated/user/user-update-one-required-without-comments.input.ts @@ -11,23 +11,23 @@ export class UserUpdateOneRequiredWithoutCommentsInput { nullable: true, description: undefined, }) - create?: UserCreateWithoutCommentsInput | null; + create?: UserCreateWithoutCommentsInput; @Field(() => UserWhereUniqueInput, { nullable: true, description: undefined, }) - connect?: UserWhereUniqueInput | null; + connect?: UserWhereUniqueInput; @Field(() => UserUpdateWithoutCommentsDataInput, { nullable: true, description: undefined, }) - update?: UserUpdateWithoutCommentsDataInput | null; + update?: UserUpdateWithoutCommentsDataInput; @Field(() => UserUpsertWithoutCommentsInput, { nullable: true, description: undefined, }) - upsert?: UserUpsertWithoutCommentsInput | null; + upsert?: UserUpsertWithoutCommentsInput; } diff --git a/src/@generated/user/user-update-with-where-unique-without-favorite-articles.input.ts b/src/@generated/user/user-update-with-where-unique-without-favorite-articles.input.ts index ca5b968c..c914e7e8 100644 --- a/src/@generated/user/user-update-with-where-unique-without-favorite-articles.input.ts +++ b/src/@generated/user/user-update-with-where-unique-without-favorite-articles.input.ts @@ -9,11 +9,11 @@ export class UserUpdateWithWhereUniqueWithoutFavoriteArticlesInput { nullable: true, description: undefined, }) - where?: UserWhereUniqueInput | null; + where?: UserWhereUniqueInput; @Field(() => UserUpdateWithoutFavoriteArticlesDataInput, { nullable: true, description: undefined, }) - data?: UserUpdateWithoutFavoriteArticlesDataInput | null; + data?: UserUpdateWithoutFavoriteArticlesDataInput; } diff --git a/src/@generated/user/user-update-with-where-unique-without-followers.input.ts b/src/@generated/user/user-update-with-where-unique-without-followers.input.ts index f062550f..ebbb98b7 100644 --- a/src/@generated/user/user-update-with-where-unique-without-followers.input.ts +++ b/src/@generated/user/user-update-with-where-unique-without-followers.input.ts @@ -9,11 +9,11 @@ export class UserUpdateWithWhereUniqueWithoutFollowersInput { nullable: true, description: undefined, }) - where?: UserWhereUniqueInput | null; + where?: UserWhereUniqueInput; @Field(() => UserUpdateWithoutFollowersDataInput, { nullable: true, description: undefined, }) - data?: UserUpdateWithoutFollowersDataInput | null; + data?: UserUpdateWithoutFollowersDataInput; } diff --git a/src/@generated/user/user-update-with-where-unique-without-following.input.ts b/src/@generated/user/user-update-with-where-unique-without-following.input.ts index 4a66430d..63cab5ea 100644 --- a/src/@generated/user/user-update-with-where-unique-without-following.input.ts +++ b/src/@generated/user/user-update-with-where-unique-without-following.input.ts @@ -9,11 +9,11 @@ export class UserUpdateWithWhereUniqueWithoutFollowingInput { nullable: true, description: undefined, }) - where?: UserWhereUniqueInput | null; + where?: UserWhereUniqueInput; @Field(() => UserUpdateWithoutFollowingDataInput, { nullable: true, description: undefined, }) - data?: UserUpdateWithoutFollowingDataInput | null; + data?: UserUpdateWithoutFollowingDataInput; } diff --git a/src/@generated/user/user-update-without-articles-data.input.ts b/src/@generated/user/user-update-without-articles-data.input.ts index f351142a..dce02a88 100644 --- a/src/@generated/user/user-update-without-articles-data.input.ts +++ b/src/@generated/user/user-update-without-articles-data.input.ts @@ -11,25 +11,25 @@ export class UserUpdateWithoutArticlesDataInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - email?: string | null; + email?: string; @Field(() => String, { nullable: true, description: undefined, }) - name?: string | null; + name?: string; @Field(() => String, { nullable: true, description: undefined, }) - password?: string | null; + password?: string; @Field(() => String, { nullable: true, diff --git a/src/@generated/user/user-update-without-comments-data.input.ts b/src/@generated/user/user-update-without-comments-data.input.ts index be47faef..41d1a860 100644 --- a/src/@generated/user/user-update-without-comments-data.input.ts +++ b/src/@generated/user/user-update-without-comments-data.input.ts @@ -11,25 +11,25 @@ export class UserUpdateWithoutCommentsDataInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - email?: string | null; + email?: string; @Field(() => String, { nullable: true, description: undefined, }) - name?: string | null; + name?: string; @Field(() => String, { nullable: true, description: undefined, }) - password?: string | null; + password?: string; @Field(() => String, { nullable: true, diff --git a/src/@generated/user/user-update-without-favorite-articles-data.input.ts b/src/@generated/user/user-update-without-favorite-articles-data.input.ts index 5755e0e2..4a4dbc41 100644 --- a/src/@generated/user/user-update-without-favorite-articles-data.input.ts +++ b/src/@generated/user/user-update-without-favorite-articles-data.input.ts @@ -11,25 +11,25 @@ export class UserUpdateWithoutFavoriteArticlesDataInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - email?: string | null; + email?: string; @Field(() => String, { nullable: true, description: undefined, }) - name?: string | null; + name?: string; @Field(() => String, { nullable: true, description: undefined, }) - password?: string | null; + password?: string; @Field(() => String, { nullable: true, diff --git a/src/@generated/user/user-update-without-followers-data.input.ts b/src/@generated/user/user-update-without-followers-data.input.ts index bab7fa5f..3280003d 100644 --- a/src/@generated/user/user-update-without-followers-data.input.ts +++ b/src/@generated/user/user-update-without-followers-data.input.ts @@ -11,25 +11,25 @@ export class UserUpdateWithoutFollowersDataInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - email?: string | null; + email?: string; @Field(() => String, { nullable: true, description: undefined, }) - name?: string | null; + name?: string; @Field(() => String, { nullable: true, description: undefined, }) - password?: string | null; + password?: string; @Field(() => String, { nullable: true, diff --git a/src/@generated/user/user-update-without-following-data.input.ts b/src/@generated/user/user-update-without-following-data.input.ts index e5228eaa..6046a8f2 100644 --- a/src/@generated/user/user-update-without-following-data.input.ts +++ b/src/@generated/user/user-update-without-following-data.input.ts @@ -11,25 +11,25 @@ export class UserUpdateWithoutFollowingDataInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - email?: string | null; + email?: string; @Field(() => String, { nullable: true, description: undefined, }) - name?: string | null; + name?: string; @Field(() => String, { nullable: true, description: undefined, }) - password?: string | null; + password?: string; @Field(() => String, { nullable: true, diff --git a/src/@generated/user/user-update.input.ts b/src/@generated/user/user-update.input.ts index 7c8eb32f..7e1b8bd7 100644 --- a/src/@generated/user/user-update.input.ts +++ b/src/@generated/user/user-update.input.ts @@ -12,25 +12,25 @@ export class UserUpdateInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - email?: string | null; + email?: string; @Field(() => String, { nullable: true, description: undefined, }) - name?: string | null; + name?: string; @Field(() => String, { nullable: true, description: undefined, }) - password?: string | null; + password?: string; @Field(() => String, { nullable: true, diff --git a/src/@generated/user/user-upsert-with-where-unique-without-favorite-articles.input.ts b/src/@generated/user/user-upsert-with-where-unique-without-favorite-articles.input.ts index f7d7de6c..35c650ce 100644 --- a/src/@generated/user/user-upsert-with-where-unique-without-favorite-articles.input.ts +++ b/src/@generated/user/user-upsert-with-where-unique-without-favorite-articles.input.ts @@ -10,17 +10,17 @@ export class UserUpsertWithWhereUniqueWithoutFavoriteArticlesInput { nullable: true, description: undefined, }) - where?: UserWhereUniqueInput | null; + where?: UserWhereUniqueInput; @Field(() => UserUpdateWithoutFavoriteArticlesDataInput, { nullable: true, description: undefined, }) - update?: UserUpdateWithoutFavoriteArticlesDataInput | null; + update?: UserUpdateWithoutFavoriteArticlesDataInput; @Field(() => UserCreateWithoutFavoriteArticlesInput, { nullable: true, description: undefined, }) - create?: UserCreateWithoutFavoriteArticlesInput | null; + create?: UserCreateWithoutFavoriteArticlesInput; } diff --git a/src/@generated/user/user-upsert-with-where-unique-without-followers.input.ts b/src/@generated/user/user-upsert-with-where-unique-without-followers.input.ts index bd35ee12..4c30217a 100644 --- a/src/@generated/user/user-upsert-with-where-unique-without-followers.input.ts +++ b/src/@generated/user/user-upsert-with-where-unique-without-followers.input.ts @@ -10,17 +10,17 @@ export class UserUpsertWithWhereUniqueWithoutFollowersInput { nullable: true, description: undefined, }) - where?: UserWhereUniqueInput | null; + where?: UserWhereUniqueInput; @Field(() => UserUpdateWithoutFollowersDataInput, { nullable: true, description: undefined, }) - update?: UserUpdateWithoutFollowersDataInput | null; + update?: UserUpdateWithoutFollowersDataInput; @Field(() => UserCreateWithoutFollowersInput, { nullable: true, description: undefined, }) - create?: UserCreateWithoutFollowersInput | null; + create?: UserCreateWithoutFollowersInput; } diff --git a/src/@generated/user/user-upsert-with-where-unique-without-following.input.ts b/src/@generated/user/user-upsert-with-where-unique-without-following.input.ts index 5cd1deff..056550a6 100644 --- a/src/@generated/user/user-upsert-with-where-unique-without-following.input.ts +++ b/src/@generated/user/user-upsert-with-where-unique-without-following.input.ts @@ -10,17 +10,17 @@ export class UserUpsertWithWhereUniqueWithoutFollowingInput { nullable: true, description: undefined, }) - where?: UserWhereUniqueInput | null; + where?: UserWhereUniqueInput; @Field(() => UserUpdateWithoutFollowingDataInput, { nullable: true, description: undefined, }) - update?: UserUpdateWithoutFollowingDataInput | null; + update?: UserUpdateWithoutFollowingDataInput; @Field(() => UserCreateWithoutFollowingInput, { nullable: true, description: undefined, }) - create?: UserCreateWithoutFollowingInput | null; + create?: UserCreateWithoutFollowingInput; } diff --git a/src/@generated/user/user-upsert-without-articles.input.ts b/src/@generated/user/user-upsert-without-articles.input.ts index a6e40e1f..b5a06c01 100644 --- a/src/@generated/user/user-upsert-without-articles.input.ts +++ b/src/@generated/user/user-upsert-without-articles.input.ts @@ -9,11 +9,11 @@ export class UserUpsertWithoutArticlesInput { nullable: true, description: undefined, }) - update?: UserUpdateWithoutArticlesDataInput | null; + update?: UserUpdateWithoutArticlesDataInput; @Field(() => UserCreateWithoutArticlesInput, { nullable: true, description: undefined, }) - create?: UserCreateWithoutArticlesInput | null; + create?: UserCreateWithoutArticlesInput; } diff --git a/src/@generated/user/user-upsert-without-comments.input.ts b/src/@generated/user/user-upsert-without-comments.input.ts index 561e131c..5143715b 100644 --- a/src/@generated/user/user-upsert-without-comments.input.ts +++ b/src/@generated/user/user-upsert-without-comments.input.ts @@ -9,11 +9,11 @@ export class UserUpsertWithoutCommentsInput { nullable: true, description: undefined, }) - update?: UserUpdateWithoutCommentsDataInput | null; + update?: UserUpdateWithoutCommentsDataInput; @Field(() => UserCreateWithoutCommentsInput, { nullable: true, description: undefined, }) - create?: UserCreateWithoutCommentsInput | null; + create?: UserCreateWithoutCommentsInput; } diff --git a/src/@generated/user/user-where-unique.input.ts b/src/@generated/user/user-where-unique.input.ts index 9481d8d1..d7b6da02 100644 --- a/src/@generated/user/user-where-unique.input.ts +++ b/src/@generated/user/user-where-unique.input.ts @@ -6,17 +6,17 @@ export class UserWhereUniqueInput { nullable: true, description: undefined, }) - id?: string | null; + id?: string; @Field(() => String, { nullable: true, description: undefined, }) - email?: string | null; + email?: string; @Field(() => String, { nullable: true, description: undefined, }) - name?: string | null; + name?: string; } diff --git a/src/@generated/user/user-where.input.ts b/src/@generated/user/user-where.input.ts index 40c94e32..5018bc98 100644 --- a/src/@generated/user/user-where.input.ts +++ b/src/@generated/user/user-where.input.ts @@ -13,25 +13,25 @@ export class UserWhereInput { nullable: true, description: undefined, }) - id?: string | StringFilter | null; + id?: string | StringFilter; @Field(() => StringFilter, { nullable: true, description: undefined, }) - email?: string | StringFilter | null; + email?: string | StringFilter; @Field(() => StringFilter, { nullable: true, description: undefined, }) - name?: string | StringFilter | null; + name?: string | StringFilter; @Field(() => StringFilter, { nullable: true, description: undefined, }) - password?: string | StringFilter | null; + password?: string | StringFilter; @Field(() => NullableStringFilter, { nullable: true, @@ -85,17 +85,17 @@ export class UserWhereInput { nullable: true, description: undefined, }) - AND?: UserWhereInput | UserWhereInput[] | null; + AND?: UserWhereInput | Array; @Field(() => [UserWhereInput], { nullable: true, description: undefined, }) - OR?: UserWhereInput | UserWhereInput[] | null; + OR?: Array; @Field(() => [UserWhereInput], { nullable: true, description: undefined, }) - NOT?: UserWhereInput | UserWhereInput[] | null; + NOT?: UserWhereInput | Array; } diff --git a/src/generate-file-name.ts b/src/generate-file-name.ts index 23614070..e43c51de 100644 --- a/src/generate-file-name.ts +++ b/src/generate-file-name.ts @@ -36,14 +36,8 @@ type GenerateFileNameArgs = { export function generateFileName(args: GenerateFileNameArgs) { const { type, name, models } = args; const template = args.template || '{feature}/{dasherizedName}.{type}.ts'; - let feature = 'prisma'; - for (const keyword of splitKeywords) { - const [test] = name.split(keyword, 1); - if (models.includes(test)) { - feature = toKebab(test); - break; - } - } + let feature = getFeatureName({ models, name, fallback: 'prisma' }); + feature = toKebab(feature); let dasherizedName = toKebab(name); for (const suffix of ['input', 'enum']) { @@ -60,3 +54,22 @@ export function generateFileName(args: GenerateFileNameArgs) { dasherizedName, }); } + +type GetFeatureNameArgs = { + name: string; + models: string[]; + fallback: string; +}; + +export function getFeatureName(args: GetFeatureNameArgs) { + const { name, models } = args; + let result = args.fallback; + for (const keyword of splitKeywords) { + const [test] = name.split(keyword, 1); + if (models.includes(test)) { + result = test; + break; + } + } + return result; +} diff --git a/src/generate-input.spec.ts b/src/generate-input.spec.ts index ee6eae62..64724c75 100644 --- a/src/generate-input.spec.ts +++ b/src/generate-input.spec.ts @@ -7,28 +7,36 @@ import { generatorOptions, stringContains, stringNotContains } from './testing'; describe('generate inputs', () => { let sourceFile: SourceFile; let sourceText: string; + let imports: { name: string; specifier: string }[]; type Options = { schema: string; name: string; + model: string | undefined; sourceFileText?: string; outputFilePattern?: string; }; - let imports: { name: string; specifier: string }[]; - async function getResult(options: Options) { - const { schema, name, sourceFileText, outputFilePattern } = options; + const getResult = async (options: Options) => { + const { schema, model, name, sourceFileText, outputFilePattern } = options; const project = new Project({ useInMemoryFileSystem: true, manipulationSettings: { quoteKind: QuoteKind.Single }, }); const { prismaClientDmmf: { + datamodel: { models }, schema: { inputTypes }, }, } = await generatorOptions(schema, { outputFilePattern }); + // console.log('inputTypes', inputTypes); const inputType = inputTypes.find((x) => x.name === name); - assert(inputType); + assert(inputType, `Failed to find ${name}`); sourceFile = project.createSourceFile('0.ts', sourceFileText); - generateInput({ inputType, sourceFile, projectFilePath: () => '0.ts' }); + generateInput({ + model: models.find((x) => x.name === model), + inputType, + sourceFile, + projectFilePath: () => '0.ts', + }); sourceText = sourceFile.getText(); imports = sourceFile.getImportDeclarations().flatMap((d) => d.getNamedImports().map((i) => ({ @@ -36,21 +44,27 @@ describe('generate inputs', () => { specifier: d.getModuleSpecifierValue(), })), ); - } + }; it('user where input', async () => { await getResult({ schema: ` model User { id String @id + birth DateTime + died DateTime? } `, name: 'UserWhereInput', + model: 'User', }); - - const structure = sourceFile.getClass('UserWhereInput')?.getProperty('id')?.getStructure(); - assert(structure); - assert.strictEqual(structure.type, 'string | StringFilter | null'); + const struct = (n: string) => + sourceFile.getClass('UserWhereInput')?.getProperty(n)?.getStructure(); + assert.strictEqual( + struct('id')?.type, + 'string | StringFilter', + 'id is not nullable in model', + ); const decoratorArguments = sourceFile .getClass('UserWhereInput') ?.getProperty('id') @@ -58,6 +72,12 @@ describe('generate inputs', () => { ?.getCallExpression() ?.getArguments(); assert.strictEqual(decoratorArguments?.[0]?.getText(), '() => StringFilter'); + assert.strictEqual( + struct('OR')?.type, + 'UserWhereInput[]', + 'OR property should be array only', + ); + assert.strictEqual(struct('birth')?.type, 'Date | string | DateTimeFilter'); }); it('user where int filter', async () => { @@ -69,10 +89,11 @@ describe('generate inputs', () => { } `, name: 'UserWhereInput', + model: 'User', }); const structure = sourceFile.getClass('UserWhereInput')?.getProperty('age')?.getStructure(); assert(structure); - assert.strictEqual(structure.type, 'number | IntFilter | null'); + assert.strictEqual(structure.type, 'number | IntFilter', 'Age property is not nullable'); const decoratorArguments = sourceFile .getClass('UserWhereInput') @@ -86,6 +107,33 @@ describe('generate inputs', () => { assert(imports.find((x) => x.name === 'IntFilter' && x.specifier === './0')); }); + it('user where string filter', async () => { + await getResult({ + schema: ` + model User { + id String @id + } + `, + name: 'StringFilter', + model: undefined, + }); + const properties = sourceFile.getClass('StringFilter')?.getProperties(); + const structure = (name: string) => + properties?.find((x) => x.getName() === name)?.getStructure(); + + assert.strictEqual(structure('equals')?.type, 'string'); + assert.strictEqual(structure('lt')?.type, 'string'); + assert.strictEqual(structure('lte')?.type, 'string'); + assert.strictEqual(structure('gt')?.type, 'string'); + assert.strictEqual(structure('gte')?.type, 'string'); + assert.strictEqual(structure('contains')?.type, 'string'); + assert.strictEqual(structure('startsWith')?.type, 'string'); + assert.strictEqual(structure('endsWith')?.type, 'string'); + + assert.strictEqual(structure('in')?.type, 'string | string[]'); + assert.strictEqual(structure('notIn')?.type, 'string | string[]'); + }); + it('user create input', async () => { await getResult({ schema: ` @@ -95,6 +143,7 @@ describe('generate inputs', () => { } `, name: 'UserCreateInput', + model: 'User', }); const idProperty = sourceFile.getClass('UserCreateInput')?.getProperty('id'); @@ -124,7 +173,7 @@ describe('generate inputs', () => { assert(imports.find((x) => x.name === 'Int' && x.specifier === '@nestjs/graphql')); }); - it('no datetime import', async () => { + it('datetime filter', async () => { await getResult({ schema: ` model User { @@ -134,6 +183,7 @@ describe('generate inputs', () => { } `, name: 'DateTimeFilter', + model: 'User', }); sourceFile .getClass('DateTimeFilter') @@ -145,4 +195,24 @@ describe('generate inputs', () => { stringNotContains('DateTime', argument || ''); }); }); + + it('user filter', async () => { + await getResult({ + schema: ` + model User { + id String @id + following User[] @relation("UserFollows", references: [id]) + followers User[] @relation("UserFollows", references: [id]) + } + `, + name: 'UserFilter', + model: 'User', + }); + const struct = (n: string) => + sourceFile.getClass('UserFilter')?.getProperty(n)?.getStructure(); + + assert.strictEqual(struct('every')?.type, 'UserWhereInput'); + assert.strictEqual(struct('some')?.type, 'UserWhereInput'); + assert.strictEqual(struct('none')?.type, 'UserWhereInput'); + }); }); diff --git a/src/generate-input.ts b/src/generate-input.ts index 16f3acd3..c4928b1d 100644 --- a/src/generate-input.ts +++ b/src/generate-input.ts @@ -11,11 +11,12 @@ import { toGraphqlImportType, toPropertyType } from './type-utils'; type GenerateInputArgs = { inputType: PrismaDMMF.InputType; sourceFile: SourceFile; + model: PrismaDMMF.Model | undefined; projectFilePath(data: { name: string; type: string }): string; }; export function generateInput(args: GenerateInputArgs) { - const { inputType, sourceFile, projectFilePath } = args; + const { inputType, sourceFile, projectFilePath, model } = args; const className = inputType.name; const classDeclaration = generateClass({ sourceFile, @@ -26,26 +27,40 @@ export function generateInput(args: GenerateInputArgs) { name: className, }); generateGraphqlImport({ name: 'Field', sourceFile, moduleSpecifier: '@nestjs/graphql' }); - inputType.fields.forEach((field) => { - generateInputProperty({ field, classDeclaration, sourceFile, projectFilePath, className }); - }); + for (const field of inputType.fields) { + // console.log('field', field); + const inputType = getMatchingInputType(field.inputType); + const modelField = model?.fields.find((f) => f.name === field.name); + const nullable = + modelField?.isRequired !== undefined ? !modelField.isRequired : inputType.isNullable; + const propertyType = getPropertyType({ field, nullable }); + generateInputProperty({ + inputType, + propertyType, + classDeclaration, + sourceFile, + projectFilePath, + className, + name: field.name, + }); + } } type GenerateInputPropertyArgs = { - field: PrismaDMMF.SchemaArg; + name: string; + inputType: PrismaDMMF.SchemaArgInputType; sourceFile: SourceFile; projectFilePath(data: { name: string; type: string }): string; className: string; classDeclaration: ClassDeclaration; + propertyType: string; }; function generateInputProperty(args: GenerateInputPropertyArgs) { - const { field, sourceFile, className, classDeclaration, projectFilePath } = args; - const inputType = getMatchingInputType(field.inputType); - const propertyType = getPropertyType(field); + const { inputType, sourceFile, className, classDeclaration, projectFilePath } = args; const propertyDeclaration = generateClassProperty({ - name: field.name, - type: propertyType, + name: args.name, + type: args.propertyType, classDeclaration, isReadOnly: false, isRequired: false, @@ -85,7 +100,13 @@ function generateInputProperty(args: GenerateInputPropertyArgs) { }); } -function getPropertyType(field: PrismaDMMF.SchemaArg): string { +type GetPropertyTypeArgs = { + field: PrismaDMMF.SchemaArg; + nullable: boolean; +}; + +function getPropertyType(args: GetPropertyTypeArgs): string { + const { field, nullable } = args; const inputTypes = field.inputType; let result = inputTypes .map((inputType) => { @@ -93,14 +114,17 @@ function getPropertyType(field: PrismaDMMF.SchemaArg): string { return toPropertyType({ kind: inputType.kind, type }); }) .join(' | '); - if (field.isRelationFilter || inputTypes.every((t) => t.isList)) { - assert(inputTypes.length === 1); - result = `${result} | ${result}[]`; + if (inputTypes.every((t) => t.isList)) { + if (['AND', 'NOT', 'in', 'notIn'].includes(field.name)) { + result = `${result} | Array<${result}>`; + } else { + result = `Array<${result}>`; + } } if (!inputTypes.find((t) => t.type === 'null')) { - // TODO: To make it compatible with prisma we need get model here - // const nullable = inputTypes.every((t) => t.isNullable); - result = `${result} | null`; + if (nullable) { + result = `${result} | null`; + } } return result; } diff --git a/src/generate-model.spec.ts b/src/generate-model.spec.ts index 9866dc64..779e9cc9 100644 --- a/src/generate-model.spec.ts +++ b/src/generate-model.spec.ts @@ -7,6 +7,7 @@ import { generatorOptions, stringContains, stringNotContains } from './testing'; describe('generate models', () => { let sourceFile: SourceFile; let sourceText: string; + let imports: { name: string; specifier: string }[]; async function getResult(schema: string, { sourceFileText }: { sourceFileText?: string } = {}) { const project = new Project({ useInMemoryFileSystem: true, @@ -21,16 +22,23 @@ describe('generate models', () => { sourceFile = project.createSourceFile('_.ts', sourceFileText); generateModel({ model, sourceFile, projectFilePath: () => '_.ts' }); sourceText = sourceFile.getText(); + imports = sourceFile.getImportDeclarations().flatMap((d) => + d.getNamedImports().map((i) => ({ + name: i.getName(), + specifier: d.getModuleSpecifierValue(), + })), + ); } it('model', async () => { await getResult(`model User { id String @id }`); - sourceText = sourceFile.getText(); + assert(imports.find((x) => x.name === 'ObjectType' && x.specifier === '@nestjs/graphql')); + assert(imports.find((x) => x.name === 'ID' && x.specifier === '@nestjs/graphql')); + assert(imports.find((x) => x.name === 'Field' && x.specifier === '@nestjs/graphql')); stringContains('@Field(() => ID, { nullable: false, description: undefined })', sourceText); stringContains('id!: string', sourceText); - stringContains(`import { ObjectType, ID, Field } from '@nestjs/graphql'`, sourceText); }); it('field nullable', async () => { @@ -144,7 +152,7 @@ describe('generate models', () => { sourceText, ); stringContains( - '@Field(() => String, { nullable: false, description: undefined }) born!: string', + '@Field(() => String, { nullable: false, description: undefined }) born!: Date | string', sourceText, ); assert(imports.has('String') === false, 'Imports should not includes String'); diff --git a/src/generate-model.ts b/src/generate-model.ts index 5713aed0..fd17cd53 100644 --- a/src/generate-model.ts +++ b/src/generate-model.ts @@ -26,17 +26,16 @@ export function generateModel(args: GenerateModelArgs) { sourceFile, name: model.name, }); - model.fields - .filter((field) => !field.isGenerated) - .forEach((field) => { - generateModelProperty({ - field, - sourceFile, - classDeclaration, - className: model.name, - projectFilePath, - }); + generateGraphqlImport({ name: 'Field', sourceFile, moduleSpecifier: '@nestjs/graphql' }); + model.fields.forEach((field) => { + generateModelProperty({ + field, + sourceFile, + classDeclaration, + className: model.name, + projectFilePath, }); + }); } type GenerateModelPropertyArgs = { @@ -80,7 +79,6 @@ function generateModelProperty(args: GenerateModelPropertyArgs) { type: propertyType, classDeclaration, }); - generateGraphqlImport({ name: 'Field', sourceFile, moduleSpecifier: '@nestjs/graphql' }); generateDecorator({ fieldType, propertyDeclaration, diff --git a/src/generate.ts b/src/generate.ts index ec328ca8..f7054750 100644 --- a/src/generate.ts +++ b/src/generate.ts @@ -5,7 +5,7 @@ import { existsSync, promises as fs } from 'fs'; import { Project, QuoteKind, SourceFile } from 'ts-morph'; import { generateEnum } from './generate-enum'; -import { FileType, generateFileName } from './generate-file-name'; +import { FileType, generateFileName, getFeatureName } from './generate-file-name'; import { generateInput } from './generate-input'; import { generateModel } from './generate-model'; @@ -62,8 +62,13 @@ export async function generate(args: GenerateArgs) { } // Generate inputs for (const inputType of prismaClientDmmf.schema.inputTypes) { + let model: PrismaDMMF.Model | undefined; + const feature = getFeatureName({ name: inputType.name, models, fallback: '' }); + if (feature) { + model = prismaClientDmmf.datamodel.models.find((m) => m.name === feature); + } const sourceFile = await createSourceFile({ type: 'input', name: inputType.name }); - generateInput({ inputType, sourceFile, projectFilePath }); + generateInput({ inputType, sourceFile, projectFilePath, model }); } return project; diff --git a/src/testing/type-tests.ts b/src/testing/type-tests.ts index 3ea32989..969325aa 100644 --- a/src/testing/type-tests.ts +++ b/src/testing/type-tests.ts @@ -1,14 +1,50 @@ -// import { PrismaClient } from '@prisma/client'; -// import * as prisma from '@prisma/client'; +import { PrismaClient } from '@prisma/client'; +import * as prisma from '@prisma/client'; -// import { User } from '../@generated/user/user.model'; -// import { ArticleRelationFilter } from '../@generated/article/article-relation-filter.input'; -// import { UserWhereInput } from '../@generated/user/user-where.input'; +import { ArticleFilter } from '../@generated/article/article-filter.input'; +import { ArticleRelationFilter } from '../@generated/article/article-relation-filter.input'; +import { ArticleWhereInput } from '../@generated/article/article-where.input'; +import { DateTimeFilter } from '../@generated/prisma/date-time-filter.input'; +import { TagFilter } from '../@generated/tag/tag-filter.input'; +import { TagWhereInput } from '../@generated/tag/tag-where.input'; +import { UserFilter } from '../@generated/user/user-filter.input'; +import { UserWhereInput } from '../@generated/user/user-where.input'; +import { User } from '../@generated/user/user.model'; -// const $prisma = new PrismaClient(); +const $prisma = new PrismaClient(); -// const userfindManyWhere: UserWhereInput = {}; -// $prisma.user.findMany({ where: userfindManyWhere }); +{ + const p: prisma.DateTimeFilter = {}; + const n: DateTimeFilter = p; +} +{ + const p: prisma.UserFilter = {}; + const n: UserFilter = p; +} +{ + const p: prisma.TagWhereInput = {}; + const n: TagWhereInput = p; +} +{ + const p: prisma.UserWhereInput = {}; + const n: UserWhereInput = p; +} +{ + const p: prisma.TagFilter = {}; + const n: TagFilter = p; +} +{ + const p: prisma.ArticleFilter = {}; + const n: ArticleFilter = p; +} +{ + const p: prisma.ArticleWhereInput = {}; + const n: ArticleWhereInput = p; +} +{ + const userfindManyWhere: UserWhereInput = {}; + $prisma.user.findMany({ where: userfindManyWhere }); +} // const articleRelationFilter: ArticleRelationFilter = { is: { id: { equals: '1' } } }; // $prisma.comment.findMany({ where: { article: articleRelationFilter } }); diff --git a/src/type-utils.ts b/src/type-utils.ts index e91fd3ed..2db9628d 100644 --- a/src/type-utils.ts +++ b/src/type-utils.ts @@ -25,32 +25,11 @@ export function toGraphqlImportType(args: ToGraphqlImportTypeArgs) { const patterns = new Map([ [{ type: (type: string) => type === 'String', kind: 'scalar' }, () => 'string'], - [{ type: (type: string) => type === 'DateTime', kind: 'scalar' }, () => 'string'], + [{ type: (type: string) => type === 'DateTime', kind: 'scalar' }, () => 'Date | string'], [{ type: (type: string) => type === 'Float', kind: 'scalar' }, () => 'number'], [{ type: (type: string) => type === 'Int', kind: 'scalar' }, () => 'number'], [{ type: (type: string) => type === 'Boolean', kind: 'scalar' }, () => 'boolean'], [{ type: (type: string) => type === 'Json', kind: 'scalar' }, () => 'object'], - // [ - // { - // type: (type: string) => ['StringFilter', 'NullableStringFilter'].includes(type), - // kind: 'object', - // }, - // (field: { type: string }) => `string | ${field.type}`, - // ], - // [ - // { - // type: (type: string) => ['IntFilter', 'NullableIntFilter'].includes(type), - // kind: 'object', - // }, - // (field: { type: string }) => `number | ${field.type}`, - // ], - // [ - // { - // type: (type: string) => ['BooleanFilter', 'NullableBooleanFilter'].includes(type), - // kind: 'object', - // }, - // (field: { type: string }) => `boolean | ${field.type}`, - // ], [{ type: () => true, kind: 'object' }, (field: { type: string }) => field.type], [{ type: () => true, kind: 'enum' }, (field: { type: string }) => field.type], [{ type: () => true, kind: 'scalar' }, (field: { type: string }) => field.type],