connectrpc / connect-query-es

TypeScript-first expansion pack for TanStack Query that gives you Protobuf superpowers.

Home Page:https://connectrpc.com/docs/web/query/getting-started

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`enabled` option does not work as expected

JuoCode opened this issue · comments

return tsUseQuery({
...queryOptions,
...baseOptions,
});

I think that's the problem.

Yeah we've typically used the symbol disableQuery to indicate a disabled query. The disableQuery symbol makes it easier to guarantee typesafety on the input combined with a valid query function. To make that more explicit, we should probably remove the enabled prop as a possible input since it's generated based on input.

On closer examination of this, I think it would be consistent to still support the enabled option along with the explicit disableQuery since it will lead to less ternaries all over the place. Opened #318 to add this in.