@@ -1336,15 +1336,15 @@ describe('zodv4', () => {
13361336 export function BookSchema(): z.ZodObject<Properties<Book>> {
13371337 return z.object({
13381338 __typename: z.literal('Book').optional(),
1339- author: AuthorSchema().nullish(),
1339+ author: z.lazy(() => AuthorSchema().nullish() ),
13401340 title: z.string().nullish()
13411341 })
13421342 }
13431343
13441344 export function AuthorSchema(): z.ZodObject<Properties<Author>> {
13451345 return z.object({
13461346 __typename: z.literal('Author').optional(),
1347- books: z.array(BookSchema().nullable()).nullish(),
1347+ books: z.array(z.lazy(() => BookSchema().nullable() )).nullish(),
13481348 name: z.string().nullish()
13491349 })
13501350 }
@@ -1621,7 +1621,7 @@ describe('zodv4', () => {
16211621 export function GeometrySchema(): z.ZodObject<Properties<Geometry>> {
16221622 return z.object({
16231623 __typename: z.literal('Geometry').optional(),
1624- shape: ShapeSchema().nullish()
1624+ shape: z.lazy(() => ShapeSchema().nullish() )
16251625 })
16261626 }
16271627 "
@@ -1772,7 +1772,7 @@ describe('zodv4', () => {
17721772
17731773 export const GeometrySchema: z.ZodObject<Properties<Geometry>> = z.object({
17741774 __typename: z.literal('Geometry').optional(),
1775- shape: ShapeSchema.nullish()
1775+ shape: z.lazy(() => ShapeSchema.nullish() )
17761776 });
17771777 "
17781778 ` )
@@ -1924,14 +1924,14 @@ describe('zodv4', () => {
19241924
19251925 export function BookSchema(): z.ZodObject<Properties<Book>> {
19261926 return z.object({
1927- author: AuthorSchema().nullish(),
1927+ author: z.lazy(() => AuthorSchema().nullish() ),
19281928 title: z.string().nullish()
19291929 })
19301930 }
19311931
19321932 export function AuthorSchema(): z.ZodObject<Properties<Author>> {
19331933 return z.object({
1934- books: z.array(BookSchema().nullable()).nullish(),
1934+ books: z.array(z.lazy(() => BookSchema().nullable() )).nullish(),
19351935 name: z.string().nullish()
19361936 })
19371937 }
@@ -1987,15 +1987,15 @@ describe('zodv4', () => {
19871987 export function BookSchema(): z.ZodObject<Properties<Book>> {
19881988 return z.object({
19891989 title: z.string(),
1990- author: AuthorSchema()
1990+ author: z.lazy(() => AuthorSchema() )
19911991 })
19921992 }
19931993
19941994 export function TextbookSchema(): z.ZodObject<Properties<Textbook>> {
19951995 return z.object({
19961996 __typename: z.literal('Textbook').optional(),
19971997 title: z.string(),
1998- author: AuthorSchema(),
1998+ author: z.lazy(() => AuthorSchema() ),
19991999 courses: z.array(z.string())
20002000 })
20012001 }
@@ -2004,15 +2004,15 @@ describe('zodv4', () => {
20042004 return z.object({
20052005 __typename: z.literal('ColoringBook').optional(),
20062006 title: z.string(),
2007- author: AuthorSchema(),
2007+ author: z.lazy(() => AuthorSchema() ),
20082008 colors: z.array(z.string())
20092009 })
20102010 }
20112011
20122012 export function AuthorSchema(): z.ZodObject<Properties<Author>> {
20132013 return z.object({
20142014 __typename: z.literal('Author').optional(),
2015- books: z.array(BookSchema()).nullish(),
2015+ books: z.array(z.lazy(() => BookSchema() )).nullish(),
20162016 name: z.string().nullish()
20172017 })
20182018 }
0 commit comments