Skip to content

Commit 4ce28f1

Browse files
committed
fix: Prisma client generator is optional
closes: unlight#25
1 parent ffe70b6 commit 4ce28f1

36 files changed

+624
-32
lines changed

prisma/schema.prisma

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ datasource database {
55

66
generator client {
77
provider = "prisma-client-js"
8-
previewFeatures = ["orderByRelation", "selectRelationCount"]
8+
previewFeatures = ["orderByRelation", "selectRelationCount", "orderByAggregateGroup"]
99
}
1010

1111
generator nestgraphql {
12-
provider = "node -r ts-node/register/transpile-only src/index.ts"
13-
output = "../src/@generated"
12+
provider = "node -r ts-node/register/transpile-only src/index.ts"
13+
output = "../src/@generated"
1414
noAtomicOperations = false
1515
combineScalarFilters = false
1616
reExport = None
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Field, InputType } from '@nestjs/graphql';
2+
3+
import { SortOrder } from '../prisma/sort-order.enum';
4+
5+
@InputType()
6+
export class ArticleAvgOrderByAggregateInput {
7+
@Field(() => SortOrder, { nullable: true })
8+
favoritesCount?: SortOrder;
9+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { Field, InputType } from '@nestjs/graphql';
2+
3+
import { SortOrder } from '../prisma/sort-order.enum';
4+
5+
@InputType()
6+
export class ArticleCountOrderByAggregateInput {
7+
@Field(() => SortOrder, { nullable: true })
8+
id?: SortOrder;
9+
10+
@Field(() => SortOrder, { nullable: true })
11+
slug?: SortOrder;
12+
13+
@Field(() => SortOrder, { nullable: true })
14+
title?: SortOrder;
15+
16+
@Field(() => SortOrder, { nullable: true })
17+
description?: SortOrder;
18+
19+
@Field(() => SortOrder, { nullable: true })
20+
body?: SortOrder;
21+
22+
@Field(() => SortOrder, { nullable: true })
23+
createdAt?: SortOrder;
24+
25+
@Field(() => SortOrder, { nullable: true })
26+
updatedAt?: SortOrder;
27+
28+
@Field(() => SortOrder, { nullable: true })
29+
favoritesCount?: SortOrder;
30+
31+
@Field(() => SortOrder, { nullable: true })
32+
authorId?: SortOrder;
33+
34+
@Field(() => SortOrder, { nullable: true })
35+
active?: SortOrder;
36+
}

src/@generated/article/article-order-by.input.ts renamed to src/@generated/article/article-max-order-by-aggregate.input.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Field, InputType } from '@nestjs/graphql';
33
import { SortOrder } from '../prisma/sort-order.enum';
44

55
@InputType()
6-
export class ArticleOrderByInput {
6+
export class ArticleMaxOrderByAggregateInput {
77
@Field(() => SortOrder, { nullable: true })
88
id?: SortOrder;
99

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { Field, InputType } from '@nestjs/graphql';
2+
3+
import { SortOrder } from '../prisma/sort-order.enum';
4+
5+
@InputType()
6+
export class ArticleMinOrderByAggregateInput {
7+
@Field(() => SortOrder, { nullable: true })
8+
id?: SortOrder;
9+
10+
@Field(() => SortOrder, { nullable: true })
11+
slug?: SortOrder;
12+
13+
@Field(() => SortOrder, { nullable: true })
14+
title?: SortOrder;
15+
16+
@Field(() => SortOrder, { nullable: true })
17+
description?: SortOrder;
18+
19+
@Field(() => SortOrder, { nullable: true })
20+
body?: SortOrder;
21+
22+
@Field(() => SortOrder, { nullable: true })
23+
createdAt?: SortOrder;
24+
25+
@Field(() => SortOrder, { nullable: true })
26+
updatedAt?: SortOrder;
27+
28+
@Field(() => SortOrder, { nullable: true })
29+
favoritesCount?: SortOrder;
30+
31+
@Field(() => SortOrder, { nullable: true })
32+
authorId?: SortOrder;
33+
34+
@Field(() => SortOrder, { nullable: true })
35+
active?: SortOrder;
36+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import { Field, InputType } from '@nestjs/graphql';
2+
3+
import { SortOrder } from '../prisma/sort-order.enum';
4+
import { ArticleAvgOrderByAggregateInput } from './article-avg-order-by-aggregate.input';
5+
import { ArticleCountOrderByAggregateInput } from './article-count-order-by-aggregate.input';
6+
import { ArticleMaxOrderByAggregateInput } from './article-max-order-by-aggregate.input';
7+
import { ArticleMinOrderByAggregateInput } from './article-min-order-by-aggregate.input';
8+
import { ArticleSumOrderByAggregateInput } from './article-sum-order-by-aggregate.input';
9+
10+
@InputType()
11+
export class ArticleOrderByWithAggregationInput {
12+
@Field(() => SortOrder, { nullable: true })
13+
id?: SortOrder;
14+
15+
@Field(() => SortOrder, { nullable: true })
16+
slug?: SortOrder;
17+
18+
@Field(() => SortOrder, { nullable: true })
19+
title?: SortOrder;
20+
21+
@Field(() => SortOrder, { nullable: true })
22+
description?: SortOrder;
23+
24+
@Field(() => SortOrder, { nullable: true })
25+
body?: SortOrder;
26+
27+
@Field(() => SortOrder, { nullable: true })
28+
createdAt?: SortOrder;
29+
30+
@Field(() => SortOrder, { nullable: true })
31+
updatedAt?: SortOrder;
32+
33+
@Field(() => SortOrder, { nullable: true })
34+
favoritesCount?: SortOrder;
35+
36+
@Field(() => SortOrder, { nullable: true })
37+
authorId?: SortOrder;
38+
39+
@Field(() => SortOrder, { nullable: true })
40+
active?: SortOrder;
41+
42+
@Field(() => ArticleCountOrderByAggregateInput, { nullable: true })
43+
_count?: ArticleCountOrderByAggregateInput;
44+
45+
@Field(() => ArticleAvgOrderByAggregateInput, { nullable: true })
46+
_avg?: ArticleAvgOrderByAggregateInput;
47+
48+
@Field(() => ArticleMaxOrderByAggregateInput, { nullable: true })
49+
_max?: ArticleMaxOrderByAggregateInput;
50+
51+
@Field(() => ArticleMinOrderByAggregateInput, { nullable: true })
52+
_min?: ArticleMinOrderByAggregateInput;
53+
54+
@Field(() => ArticleSumOrderByAggregateInput, { nullable: true })
55+
_sum?: ArticleSumOrderByAggregateInput;
56+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Field, InputType } from '@nestjs/graphql';
2+
3+
import { SortOrder } from '../prisma/sort-order.enum';
4+
5+
@InputType()
6+
export class ArticleSumOrderByAggregateInput {
7+
@Field(() => SortOrder, { nullable: true })
8+
favoritesCount?: SortOrder;
9+
}

src/@generated/article/group-by-article.args.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ArticleAvgAggregateInput } from './article-avg-aggregate.input';
44
import { ArticleCountAggregateInput } from './article-count-aggregate.input';
55
import { ArticleMaxAggregateInput } from './article-max-aggregate.input';
66
import { ArticleMinAggregateInput } from './article-min-aggregate.input';
7-
import { ArticleOrderByInput } from './article-order-by.input';
7+
import { ArticleOrderByWithAggregationInput } from './article-order-by-with-aggregation.input';
88
import { ArticleScalarFieldEnum } from './article-scalar-field.enum';
99
import { ArticleScalarWhereWithAggregatesInput } from './article-scalar-where-with-aggregates.input';
1010
import { ArticleSumAggregateInput } from './article-sum-aggregate.input';
@@ -15,8 +15,8 @@ export class GroupByArticleArgs {
1515
@Field(() => ArticleWhereInput, { nullable: true })
1616
where?: ArticleWhereInput;
1717

18-
@Field(() => [ArticleOrderByInput], { nullable: true })
19-
orderBy?: Array<ArticleOrderByInput>;
18+
@Field(() => [ArticleOrderByWithAggregationInput], { nullable: true })
19+
orderBy?: Array<ArticleOrderByWithAggregationInput>;
2020

2121
@Field(() => [ArticleScalarFieldEnum], { nullable: false })
2222
by!: Array<ArticleScalarFieldEnum>;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { Field, InputType } from '@nestjs/graphql';
2+
3+
import { SortOrder } from '../prisma/sort-order.enum';
4+
5+
@InputType()
6+
export class CommentCountOrderByAggregateInput {
7+
@Field(() => SortOrder, { nullable: true })
8+
id?: SortOrder;
9+
10+
@Field(() => SortOrder, { nullable: true })
11+
createdAt?: SortOrder;
12+
13+
@Field(() => SortOrder, { nullable: true })
14+
updatedAt?: SortOrder;
15+
16+
@Field(() => SortOrder, { nullable: true })
17+
body?: SortOrder;
18+
19+
@Field(() => SortOrder, { nullable: true })
20+
authorId?: SortOrder;
21+
22+
@Field(() => SortOrder, { nullable: true })
23+
articleId?: SortOrder;
24+
}

src/@generated/comment/comment-order-by.input.ts renamed to src/@generated/comment/comment-max-order-by-aggregate.input.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Field, InputType } from '@nestjs/graphql';
33
import { SortOrder } from '../prisma/sort-order.enum';
44

55
@InputType()
6-
export class CommentOrderByInput {
6+
export class CommentMaxOrderByAggregateInput {
77
@Field(() => SortOrder, { nullable: true })
88
id?: SortOrder;
99

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { Field, InputType } from '@nestjs/graphql';
2+
3+
import { SortOrder } from '../prisma/sort-order.enum';
4+
5+
@InputType()
6+
export class CommentMinOrderByAggregateInput {
7+
@Field(() => SortOrder, { nullable: true })
8+
id?: SortOrder;
9+
10+
@Field(() => SortOrder, { nullable: true })
11+
createdAt?: SortOrder;
12+
13+
@Field(() => SortOrder, { nullable: true })
14+
updatedAt?: SortOrder;
15+
16+
@Field(() => SortOrder, { nullable: true })
17+
body?: SortOrder;
18+
19+
@Field(() => SortOrder, { nullable: true })
20+
authorId?: SortOrder;
21+
22+
@Field(() => SortOrder, { nullable: true })
23+
articleId?: SortOrder;
24+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { Field, InputType } from '@nestjs/graphql';
2+
3+
import { SortOrder } from '../prisma/sort-order.enum';
4+
import { CommentCountOrderByAggregateInput } from './comment-count-order-by-aggregate.input';
5+
import { CommentMaxOrderByAggregateInput } from './comment-max-order-by-aggregate.input';
6+
import { CommentMinOrderByAggregateInput } from './comment-min-order-by-aggregate.input';
7+
8+
@InputType()
9+
export class CommentOrderByWithAggregationInput {
10+
@Field(() => SortOrder, { nullable: true })
11+
id?: SortOrder;
12+
13+
@Field(() => SortOrder, { nullable: true })
14+
createdAt?: SortOrder;
15+
16+
@Field(() => SortOrder, { nullable: true })
17+
updatedAt?: SortOrder;
18+
19+
@Field(() => SortOrder, { nullable: true })
20+
body?: SortOrder;
21+
22+
@Field(() => SortOrder, { nullable: true })
23+
authorId?: SortOrder;
24+
25+
@Field(() => SortOrder, { nullable: true })
26+
articleId?: SortOrder;
27+
28+
@Field(() => CommentCountOrderByAggregateInput, { nullable: true })
29+
_count?: CommentCountOrderByAggregateInput;
30+
31+
@Field(() => CommentMaxOrderByAggregateInput, { nullable: true })
32+
_max?: CommentMaxOrderByAggregateInput;
33+
34+
@Field(() => CommentMinOrderByAggregateInput, { nullable: true })
35+
_min?: CommentMinOrderByAggregateInput;
36+
}

src/@generated/comment/group-by-comment.args.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ArgsType, Field, Int } from '@nestjs/graphql';
33
import { CommentCountAggregateInput } from './comment-count-aggregate.input';
44
import { CommentMaxAggregateInput } from './comment-max-aggregate.input';
55
import { CommentMinAggregateInput } from './comment-min-aggregate.input';
6-
import { CommentOrderByInput } from './comment-order-by.input';
6+
import { CommentOrderByWithAggregationInput } from './comment-order-by-with-aggregation.input';
77
import { CommentScalarFieldEnum } from './comment-scalar-field.enum';
88
import { CommentScalarWhereWithAggregatesInput } from './comment-scalar-where-with-aggregates.input';
99
import { CommentWhereInput } from './comment-where.input';
@@ -13,8 +13,8 @@ export class GroupByCommentArgs {
1313
@Field(() => CommentWhereInput, { nullable: true })
1414
where?: CommentWhereInput;
1515

16-
@Field(() => [CommentOrderByInput], { nullable: true })
17-
orderBy?: Array<CommentOrderByInput>;
16+
@Field(() => [CommentOrderByWithAggregationInput], { nullable: true })
17+
orderBy?: Array<CommentOrderByWithAggregationInput>;
1818

1919
@Field(() => [CommentScalarFieldEnum], { nullable: false })
2020
by!: Array<CommentScalarFieldEnum>;
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { Field, InputType } from '@nestjs/graphql';
2+
3+
import { SortOrder } from '../prisma/sort-order.enum';
4+
5+
@InputType()
6+
export class DummyAvgOrderByAggregateInput {
7+
@Field(() => SortOrder, { nullable: true })
8+
floaty?: SortOrder;
9+
10+
@Field(() => SortOrder, { nullable: true })
11+
int?: SortOrder;
12+
13+
@Field(() => SortOrder, { nullable: true })
14+
float?: SortOrder;
15+
16+
@Field(() => SortOrder, { nullable: true })
17+
decimal?: SortOrder;
18+
19+
@Field(() => SortOrder, { nullable: true })
20+
bigInt?: SortOrder;
21+
}

src/@generated/dummy/dummy-order-by.input.ts renamed to src/@generated/dummy/dummy-count-order-by-aggregate.input.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Field, InputType } from '@nestjs/graphql';
33
import { SortOrder } from '../prisma/sort-order.enum';
44

55
@InputType()
6-
export class DummyOrderByInput {
6+
export class DummyCountOrderByAggregateInput {
77
@Field(() => SortOrder, { nullable: true })
88
id?: SortOrder;
99

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { Field, InputType } from '@nestjs/graphql';
2+
3+
import { SortOrder } from '../prisma/sort-order.enum';
4+
5+
@InputType()
6+
export class DummyMaxOrderByAggregateInput {
7+
@Field(() => SortOrder, { nullable: true })
8+
id?: SortOrder;
9+
10+
@Field(() => SortOrder, { nullable: true })
11+
floaty?: SortOrder;
12+
13+
@Field(() => SortOrder, { nullable: true })
14+
int?: SortOrder;
15+
16+
@Field(() => SortOrder, { nullable: true })
17+
float?: SortOrder;
18+
19+
@Field(() => SortOrder, { nullable: true })
20+
bytes?: SortOrder;
21+
22+
@Field(() => SortOrder, { nullable: true })
23+
decimal?: SortOrder;
24+
25+
@Field(() => SortOrder, { nullable: true })
26+
bigInt?: SortOrder;
27+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { Field, InputType } from '@nestjs/graphql';
2+
3+
import { SortOrder } from '../prisma/sort-order.enum';
4+
5+
@InputType()
6+
export class DummyMinOrderByAggregateInput {
7+
@Field(() => SortOrder, { nullable: true })
8+
id?: SortOrder;
9+
10+
@Field(() => SortOrder, { nullable: true })
11+
floaty?: SortOrder;
12+
13+
@Field(() => SortOrder, { nullable: true })
14+
int?: SortOrder;
15+
16+
@Field(() => SortOrder, { nullable: true })
17+
float?: SortOrder;
18+
19+
@Field(() => SortOrder, { nullable: true })
20+
bytes?: SortOrder;
21+
22+
@Field(() => SortOrder, { nullable: true })
23+
decimal?: SortOrder;
24+
25+
@Field(() => SortOrder, { nullable: true })
26+
bigInt?: SortOrder;
27+
}

0 commit comments

Comments
 (0)