Skip to content

Commit 1cb521f

Browse files
committed
fixed example again
1 parent ff8dc02 commit 1cb521f

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

example/myzod/schemas.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,5 @@ export function UserSchema(): myzod.Type<User> {
106106
}
107107

108108
export function UserKindSchema() {
109-
return AdminSchema()
109+
return myzod.union([AdminSchema(), GuestSchema()])
110110
}

example/test.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type Guest {
1313
lastLoggedIn: Date
1414
}
1515

16-
union UserKind = Admin
16+
union UserKind = Admin | Guest
1717

1818
type User {
1919
id: ID

example/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,4 @@ export type User = {
108108
updatedAt?: Maybe<Scalars['Date']>;
109109
};
110110

111-
export type UserKind = Admin;
111+
export type UserKind = Admin | Guest;

example/yup/schemas.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,5 +110,5 @@ export function UserSchema(): yup.SchemaOf<User> {
110110
}
111111

112112
export function UserKindSchema(): yup.BaseSchema<UserKind> {
113-
return union<UserKind>(AdminSchema())
113+
return union<UserKind>(AdminSchema(), GuestSchema())
114114
}

example/zod/schemas.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,5 +114,5 @@ export function UserSchema(): z.ZodObject<Properties<User>> {
114114
}
115115

116116
export function UserKindSchema() {
117-
return AdminSchema()
117+
return z.union([AdminSchema(), GuestSchema()])
118118
}

0 commit comments

Comments
 (0)