how to use types on frontend
Hey guyz, according to: https://discord.com/channels/1043890932593987624/1179496917420490782 it is possible to get types for inserts or reads; thats super dope, but I have a question, I am not sure how to use those types on fronted.
Got two folders, one for backend with expressjs + drizzle and second one for frontend (svelte + sveltekit). How can I import those types?
backend
fronted
3 Replies
sorry, I meant this one:
const createProductVariantSchema = createInsertSchema(productVariant);
used for insertingThis is not a type, this is runtime value.
You can import this in the backend:
But the validation will bring the drizzle dependency with it probably
Also, I'm assuming you're in a monorepo
oh what a pity ;/, I thought it would be possible to have one source of truth for zod objects
yea