How to extract types from schema if possible ?
How can I get the type of
trendingComicsData
from the schema ?5 Replies
this is the schema
If there is a better another way of getting the type than please do help me thanks
Doc<"comics"> is a document from the comics table
so
Doc<"comics">[]
is probably the type you want here
autocomplete on the table name and everything will workGitHub
convex-demos/node/convex/messages.ts at d4b6b97ce839ade881109653a6f...
Demo apps built on Convex. Contribute to get-convex/convex-demos development by creating an account on GitHub.
Thanks @jamwt for the super quick response , its solved
https://stack.convex.dev/types-cookbook and https://docs.convex.dev/typescript might be helpful to read too
Types and Validators in TypeScript: A Convex Cookbook
It can be tough to wrangle types to behave how you want them to. Thankfully, Convex was designed to make the experience with types perfect. Learn why ...
TypeScript | Convex Developer Hub
Move faster with end-to-end type safety.