How to extract types from schema if possible ?
export const getTrendingComics = query({
args: { id: v.string() },
handler: async (ctx) => {
const trendingComicsData: any = [];
const webData = await ctx.db.query("websiteContent").first();
const trendingComicsIdArray = webData?.trendingComics;
if (trendingComicsIdArray) {
await Promise.all(
trendingComicsIdArray.map(async (id) => {
const comic = await ctx.db.get(id);
trendingComicsData.push(comic);
})
);
}
return trendingComicsData;
},
});export const getTrendingComics = query({
args: { id: v.string() },
handler: async (ctx) => {
const trendingComicsData: any = [];
const webData = await ctx.db.query("websiteContent").first();
const trendingComicsIdArray = webData?.trendingComics;
if (trendingComicsIdArray) {
await Promise.all(
trendingComicsIdArray.map(async (id) => {
const comic = await ctx.db.get(id);
trendingComicsData.push(comic);
})
);
}
return trendingComicsData;
},
});How can I get the type of
trendingComicsDatatrendingComicsData from the schema ?