demoCode: publicProcedure.query(async () => {
return await Promise.all(
(
await Promise.resolve([{ name: "TEST" }])
)
.map(async (s) => {
const tables = await Promise.all(
// (A) Does NOT type correctly on client with:
// await prisma.X.findMany(...)
// (B) DOES type correctly with dummy data.
(
await Promise.resolve([{ id: 3 }, { id: 5 }])
).map((table) => ({
id: table.id,
}))
);
return {
...s,
tables: tables,
};
})
);
})
demoCode: publicProcedure.query(async () => {
return await Promise.all(
(
await Promise.resolve([{ name: "TEST" }])
)
.map(async (s) => {
const tables = await Promise.all(
// (A) Does NOT type correctly on client with:
// await prisma.X.findMany(...)
// (B) DOES type correctly with dummy data.
(
await Promise.resolve([{ id: 3 }, { id: 5 }])
).map((table) => ({
id: table.id,
}))
);
return {
...s,
tables: tables,
};
})
);
})