RagpudR
Convex Communityβ€’2y agoβ€’
5 replies
Ragpud

Ents + Server components

Hello πŸ‘‹

I'm using convex with NextJS and the
preloadQuery
and fetchQuery methods are working great for me. The only thing I can see getting in my way a the moment is the Ents types.

In the docs it says you can specify a prop from a server component with:
  preloadedTasks: Preloaded<typeof api.tasks.list>;

However when using Ents the return type of queries doesn't equal Preloaded<typeof api.tasks.list>. I can't see anything in the Ents docs about this. So what I'm asking is: is what I'm trying to do not possible, not been tried before yet or just not documented yet?

I reckon the answer lies in just a fancy typescript type, although unfortunately I'm not good enough with typescript yet to figure it out.
Was this page helpful?