Nested "with" queries infer type "any"

The types for my queries with relations, are not inferred, and instead are always typed as "any". So for example, what's mentioned in the docs... const users = await db.query.users.findMany({ with: { posts: { with: { comments: true, }, }, }, }); "For any nested with queries Drizzle will infer types using Core Type API." ...this does not seem to happen for me. For none of my queries. So the example above, posts and comments would both be inferred as type "any". I have properly defined and exported my schema, including tables and relations. I have successfully generated and run migrations. I am able to run my nested with queries and the relations are properly returned, so no issues there either. Furthermore, I don't remember this not working when I first started my project, and I exported a couple of tables and relations from a single file. Does anyone have an idea what might be going wrong? https://orm.drizzle.team/docs/rqb
Drizzle ORM - Query
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
2 Replies
Steven
Steven2mo ago
Switching from neovim to vscode, the types are now properly inferred (quality of life just gone up significantly lol). It must've been related to my neovim LSP setup...
Chrissi
Chrissi2mo ago
which plugin are you using? i have the same issue with neovim, but in vscode it's also the same
Want results from more Discord servers?
Add your server