Zod Types not inferring
Hey!
Love this library
I just encountered a strange error and I am unsure if its a Tanstack error, Zod or zod-drizzle error. I just wanted to mention this in case other run in to the same bug.
Here is my case:
UpdateCarSchemaNotCurrentlyWorking is identical to UpdateCarSchema but when using UpdateCarSchemaNotCurrentlyWorking type intellisense is not working.
Love this library
I just encountered a strange error and I am unsure if its a Tanstack error, Zod or zod-drizzle error. I just wanted to mention this in case other run in to the same bug.
Here is my case:
export const selectCarSchema = selectUsedCars.omit({ organizationId: true, createdAt: true, updatedAt: true }).extend({
usedCarLogs: z.array(selectUsedCarLogs.omit({ usedCarId: true, createdAt: true })).nullable(),
usedCarImages: z.array(selectUsedCarImages.omit({ usedCarId: true })).nullable(),
usedCarAftermarketAddons: z.array(selectUsedCarAftermarketAddons.omit({ usedCarId: true })).nullable(),
usedCarFeatureAssociations: z.array(selectUsedCarFeatureAssociations.omit({ usedCarId: true })).nullable(),
categories: z.array(selectUsedCarCategoryAssociations.omit({ usedCarId: true })).nullable(),
})
export const updateCarSchema = selectCarSchema.superRefine((data, ctx) => {
})
export interface UpdateCarSchemaNotCurrentlyWorking extends Nullable<z.infer<typeof updateCarSchema>> {}
export type UpdateCarSchema = Nullable<Omit<SelectUsedCars, 'id' | 'organizationId' | 'createdAt' | 'updatedAt'> & {
usedCarLogs: Nullable<Omit<SelectUsedCarLogs, 'usedCarId' | 'createdAt'>>[]
usedCarImages: Nullable<Omit<SelectUsedCarImages, 'usedCarId'>>[]
usedCarAftermarketAddons: Nullable<Omit<SelectUsedCarAftermarketAddons, 'usedCarId'>>[]
usedCarFeatureAssociations: Nullable<Omit<SelectUsedCarFeatureAssociations, 'usedCarId'>>[]
}>export const selectCarSchema = selectUsedCars.omit({ organizationId: true, createdAt: true, updatedAt: true }).extend({
usedCarLogs: z.array(selectUsedCarLogs.omit({ usedCarId: true, createdAt: true })).nullable(),
usedCarImages: z.array(selectUsedCarImages.omit({ usedCarId: true })).nullable(),
usedCarAftermarketAddons: z.array(selectUsedCarAftermarketAddons.omit({ usedCarId: true })).nullable(),
usedCarFeatureAssociations: z.array(selectUsedCarFeatureAssociations.omit({ usedCarId: true })).nullable(),
categories: z.array(selectUsedCarCategoryAssociations.omit({ usedCarId: true })).nullable(),
})
export const updateCarSchema = selectCarSchema.superRefine((data, ctx) => {
})
export interface UpdateCarSchemaNotCurrentlyWorking extends Nullable<z.infer<typeof updateCarSchema>> {}
export type UpdateCarSchema = Nullable<Omit<SelectUsedCars, 'id' | 'organizationId' | 'createdAt' | 'updatedAt'> & {
usedCarLogs: Nullable<Omit<SelectUsedCarLogs, 'usedCarId' | 'createdAt'>>[]
usedCarImages: Nullable<Omit<SelectUsedCarImages, 'usedCarId'>>[]
usedCarAftermarketAddons: Nullable<Omit<SelectUsedCarAftermarketAddons, 'usedCarId'>>[]
usedCarFeatureAssociations: Nullable<Omit<SelectUsedCarFeatureAssociations, 'usedCarId'>>[]
}>UpdateCarSchemaNotCurrentlyWorking is identical to UpdateCarSchema but when using UpdateCarSchemaNotCurrentlyWorking type intellisense is not working.