|
1 | 1 | import * as z from 'zod' |
2 | | -import { Admin, AttributeInput, ButtonComponentType, ComponentInput, DropDownComponentInput, EventArgumentInput, EventInput, EventOptionType, Guest, HttpInput, HttpMethod, LayoutInput, MyType, MyTypeFooArgs, Namer, PageInput, PageType, User } from '../types' |
| 2 | +import { Admin, AttributeInput, ButtonComponentType, Comment, ComponentInput, DropDownComponentInput, EventArgumentInput, EventInput, EventOptionType, Guest, HttpInput, HttpMethod, LayoutInput, MyType, MyTypeFooArgs, Namer, PageInput, PageType, User } from '../types' |
3 | 3 |
|
4 | 4 | type Properties<T> = Required<{ |
5 | 5 | [K in keyof T]: z.ZodType<T[K]>; |
@@ -33,6 +33,13 @@ export function AttributeInputSchema(): z.ZodObject<Properties<AttributeInput>> |
33 | 33 | }) |
34 | 34 | } |
35 | 35 |
|
| 36 | +export function CommentSchema(): z.ZodObject<Properties<Comment>> { |
| 37 | + return z.object({ |
| 38 | + __typename: z.literal('Comment').optional(), |
| 39 | + replies: z.array(z.lazy(() => CommentSchema())).nullish() |
| 40 | + }) |
| 41 | +} |
| 42 | + |
36 | 43 | export function ComponentInputSchema(): z.ZodObject<Properties<ComponentInput>> { |
37 | 44 | return z.object({ |
38 | 45 | child: z.lazy(() => ComponentInputSchema().nullish()), |
@@ -128,7 +135,7 @@ export function UserSchema(): z.ZodObject<Properties<User>> { |
128 | 135 | createdAt: definedNonNullAnySchema.nullish(), |
129 | 136 | email: z.string().nullish(), |
130 | 137 | id: z.string().nullish(), |
131 | | - kind: UserKindSchema().nullish(), |
| 138 | + kind: z.lazy(() => UserKindSchema().nullish()), |
132 | 139 | name: z.string().nullish(), |
133 | 140 | password: z.string().nullish(), |
134 | 141 | updatedAt: definedNonNullAnySchema.nullish() |
|
0 commit comments