You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 6, 2023. It is now read-only.
Hi, I'm trying to utilize my existing sanity-typed-schema-builder document to create a new Zod document. I want to pick fields from the former to add to the latter. Is this possible somehow?
Example:
export const programSanitySchema = s.document({
name: 'program',
title: 'Program',
fields: [
{
name: 'title',
title: 'Title',
description: 'The title of the program',
type: s.string(),
},
{
name: 'description',
title: 'Description',
description: 'The description of the program',
type: s.string(),
}
],
});
export const programPreviewZodSchema = z.object({
title: programSanitySchema.pick({title: true})
});
Hi, I'm trying to utilize my existing sanity-typed-schema-builder document to create a new Zod document. I want to pick fields from the former to add to the latter. Is this possible somehow?
Example:
Thanks