-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: combination of zod and InputType
- Loading branch information
1 parent
888c06a
commit 9b02382
Showing
2 changed files
with
14 additions
and
6 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
nest-mercurius-monorepo/apps/server/src/features/post/dto/create-post.input.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Field, InputType } from '@nestjs/graphql'; | ||
import { createZodDto } from '@project/zod-nestjs'; | ||
import { createPostSchema } from '@project/zod-schemas'; | ||
|
||
@InputType() | ||
export class CreatePostInput extends createZodDto(createPostSchema) { | ||
@Field() | ||
title!: string; | ||
|
||
@Field() | ||
content!: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters