Skip to content

Commit

Permalink
feat: update typegraphql-prisma-nestjs to 0.2600.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Jul 9, 2023
1 parent 6f4475b commit 6199eb6
Show file tree
Hide file tree
Showing 11 changed files with 483 additions and 271 deletions.
651 changes: 408 additions & 243 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@nestjs/core": "8.2.6",
"@nestjs/graphql": "8.0.2",
"@nestjs/platform-express": "8.2.6",
"@prisma/client": "~4.14.0",
"@prisma/client": "~4.15.0",
"@prisma/sdk": "~4.0.0",
"apollo-server-express": "2.25.0",
"class-transformer": "0.5.1",
Expand All @@ -48,7 +48,7 @@
"@nestjs/cli": "8.2.0",
"@nestjs/schematics": "8.0.6",
"@nestjs/testing": "8.2.6",
"@prisma/generator-helper": "~4.14.0",
"@prisma/generator-helper": "~4.15.0",
"@types/express": "4.17.12",
"@types/graphql-fields": "^1.3.3",
"@types/node": "15.6.1",
Expand All @@ -62,13 +62,13 @@
"graphql-scalars": "^1.9.3",
"jest": "27.0.1",
"prettier": "2.3.0",
"prisma": "~4.14.0",
"prisma": "~4.15.0",
"supertest": "6.1.3",
"ts-jest": "27.0.1",
"ts-loader": "9.2.2",
"ts-node": "10.0.0",
"tsconfig-paths": "3.9.0",
"typegraphql-prisma-nestjs": "0.2500.1",
"typegraphql-prisma-nestjs": "0.2600.0",
"typescript": "4.3.5"
}
}
1 change: 1 addition & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ generator client {
generator typegraphql {
provider = "typegraphql-prisma-nestjs"
output = "../src/dal"
emitIsAbstract = true
}

model User {
Expand Down
26 changes: 18 additions & 8 deletions schema.gql
Original file line number Diff line number Diff line change
Expand Up @@ -240,23 +240,33 @@ input NestedDateTimeNullableFilter {
input UserOrderByWithRelationInput {
id: SortOrder
email: SortOrder
username: SortOrder
username: SortOrderInput
password: SortOrder
firstName: SortOrder
lastName: SortOrder
firstName: SortOrderInput
lastName: SortOrderInput
lastLogin: SortOrder
isSuperuser: SortOrder
isStaff: SortOrder
isActive: SortOrder
dateJoined: SortOrder
dateOfBirth: SortOrder
dateOfBirth: SortOrderInput
}

enum SortOrder {
asc
desc
}

input SortOrderInput {
sort: SortOrder!
nulls: NullsOrder
}

enum NullsOrder {
first
last
}

input UserWhereUniqueInput {
id: Int
email: String
Expand Down Expand Up @@ -315,16 +325,16 @@ type UserGroupBy {
input UserOrderByWithAggregationInput {
id: SortOrder
email: SortOrder
username: SortOrder
username: SortOrderInput
password: SortOrder
firstName: SortOrder
lastName: SortOrder
firstName: SortOrderInput
lastName: SortOrderInput
lastLogin: SortOrder
isSuperuser: SortOrder
isStaff: SortOrder
isActive: SortOrder
dateJoined: SortOrder
dateOfBirth: SortOrder
dateOfBirth: SortOrderInput
_count: UserCountOrderByAggregateInput
_avg: UserAvgOrderByAggregateInput
_max: UserMaxOrderByAggregateInput
Expand Down
1 change: 1 addition & 0 deletions src/dal/enhance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ const inputsInfo = {
DateTimeFilter: ["equals", "in", "notIn", "lt", "lte", "gt", "gte", "not"],
BoolFilter: ["equals", "not"],
DateTimeNullableFilter: ["equals", "in", "notIn", "lt", "lte", "gt", "gte", "not"],
SortOrderInput: ["sort", "nulls"],
UserCountOrderByAggregateInput: ["id", "email", "username", "password", "firstName", "lastName", "lastLogin", "isSuperuser", "isStaff", "isActive", "dateJoined", "dateOfBirth"],
UserAvgOrderByAggregateInput: ["id"],
UserMaxOrderByAggregateInput: ["id", "email", "username", "password", "firstName", "lastName", "lastLogin", "isSuperuser", "isStaff", "isActive", "dateJoined", "dateOfBirth"],
Expand Down
10 changes: 10 additions & 0 deletions src/dal/enums/NullsOrder.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Args, ArgsType, Context, Field, Float, ID, Info, InputType, Int, Mutation, ObjectType, Query, ResolveField, Resolver, Root, registerEnumType } from "@nestjs/graphql";

export enum NullsOrder {
first = "first",
last = "last"
}
registerEnumType(NullsOrder, {
name: "NullsOrder",
description: undefined,
});
1 change: 1 addition & 0 deletions src/dal/enums/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { NullsOrder } from "./NullsOrder";
export { SortOrder } from "./SortOrder";
export { TransactionIsolationLevel } from "./TransactionIsolationLevel";
export { UserScalarFieldEnum } from "./UserScalarFieldEnum";
21 changes: 21 additions & 0 deletions src/dal/resolvers/inputs/SortOrderInput.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Args, ArgsType, Context, Field, Float, ID, Info, InputType, Int, Mutation, ObjectType, Query, ResolveField, Resolver, Root, registerEnumType } from "@nestjs/graphql";
import * as GraphQLScalars from "graphql-scalars";
import { Prisma } from "@prisma/client";
import { DecimalJSScalar } from "../../scalars";
import { NullsOrder } from "../../enums/NullsOrder";
import { SortOrder } from "../../enums/SortOrder";

@InputType("SortOrderInput", {
isAbstract: true
})
export class SortOrderInput {
@Field(_type => SortOrder, {
nullable: false
})
sort!: "asc" | "desc";

@Field(_type => NullsOrder, {
nullable: true
})
nulls?: "first" | "last" | undefined;
}
17 changes: 9 additions & 8 deletions src/dal/resolvers/inputs/UserOrderByWithAggregationInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Args, ArgsType, Context, Field, Float, ID, Info, InputType, Int, Mutati
import * as GraphQLScalars from "graphql-scalars";
import { Prisma } from "@prisma/client";
import { DecimalJSScalar } from "../../scalars";
import { SortOrderInput } from "../inputs/SortOrderInput";
import { UserAvgOrderByAggregateInput } from "../inputs/UserAvgOrderByAggregateInput";
import { UserCountOrderByAggregateInput } from "../inputs/UserCountOrderByAggregateInput";
import { UserMaxOrderByAggregateInput } from "../inputs/UserMaxOrderByAggregateInput";
Expand All @@ -23,25 +24,25 @@ export class UserOrderByWithAggregationInput {
})
email?: "asc" | "desc" | undefined;

@Field(_type => SortOrder, {
@Field(_type => SortOrderInput, {
nullable: true
})
username?: "asc" | "desc" | undefined;
username?: SortOrderInput | undefined;

@Field(_type => SortOrder, {
nullable: true
})
password?: "asc" | "desc" | undefined;

@Field(_type => SortOrder, {
@Field(_type => SortOrderInput, {
nullable: true
})
firstName?: "asc" | "desc" | undefined;
firstName?: SortOrderInput | undefined;

@Field(_type => SortOrder, {
@Field(_type => SortOrderInput, {
nullable: true
})
lastName?: "asc" | "desc" | undefined;
lastName?: SortOrderInput | undefined;

@Field(_type => SortOrder, {
nullable: true
Expand All @@ -68,10 +69,10 @@ export class UserOrderByWithAggregationInput {
})
dateJoined?: "asc" | "desc" | undefined;

@Field(_type => SortOrder, {
@Field(_type => SortOrderInput, {
nullable: true
})
dateOfBirth?: "asc" | "desc" | undefined;
dateOfBirth?: SortOrderInput | undefined;

@Field(_type => UserCountOrderByAggregateInput, {
nullable: true
Expand Down
17 changes: 9 additions & 8 deletions src/dal/resolvers/inputs/UserOrderByWithRelationInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Args, ArgsType, Context, Field, Float, ID, Info, InputType, Int, Mutati
import * as GraphQLScalars from "graphql-scalars";
import { Prisma } from "@prisma/client";
import { DecimalJSScalar } from "../../scalars";
import { SortOrderInput } from "../inputs/SortOrderInput";
import { SortOrder } from "../../enums/SortOrder";

@InputType("UserOrderByWithRelationInput", {
Expand All @@ -18,25 +19,25 @@ export class UserOrderByWithRelationInput {
})
email?: "asc" | "desc" | undefined;

@Field(_type => SortOrder, {
@Field(_type => SortOrderInput, {
nullable: true
})
username?: "asc" | "desc" | undefined;
username?: SortOrderInput | undefined;

@Field(_type => SortOrder, {
nullable: true
})
password?: "asc" | "desc" | undefined;

@Field(_type => SortOrder, {
@Field(_type => SortOrderInput, {
nullable: true
})
firstName?: "asc" | "desc" | undefined;
firstName?: SortOrderInput | undefined;

@Field(_type => SortOrder, {
@Field(_type => SortOrderInput, {
nullable: true
})
lastName?: "asc" | "desc" | undefined;
lastName?: SortOrderInput | undefined;

@Field(_type => SortOrder, {
nullable: true
Expand All @@ -63,8 +64,8 @@ export class UserOrderByWithRelationInput {
})
dateJoined?: "asc" | "desc" | undefined;

@Field(_type => SortOrder, {
@Field(_type => SortOrderInput, {
nullable: true
})
dateOfBirth?: "asc" | "desc" | undefined;
dateOfBirth?: SortOrderInput | undefined;
}
1 change: 1 addition & 0 deletions src/dal/resolvers/inputs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export { NestedStringNullableWithAggregatesFilter } from "./NestedStringNullable
export { NestedStringWithAggregatesFilter } from "./NestedStringWithAggregatesFilter";
export { NullableDateTimeFieldUpdateOperationsInput } from "./NullableDateTimeFieldUpdateOperationsInput";
export { NullableStringFieldUpdateOperationsInput } from "./NullableStringFieldUpdateOperationsInput";
export { SortOrderInput } from "./SortOrderInput";
export { StringFieldUpdateOperationsInput } from "./StringFieldUpdateOperationsInput";
export { StringFilter } from "./StringFilter";
export { StringNullableFilter } from "./StringNullableFilter";
Expand Down

0 comments on commit 6199eb6

Please sign in to comment.