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?
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