TanStackT
TanStack9mo ago
1 reply
excited-coffee

Conditional queryOptions

Hi, does anyone know why typescript is failing at this?
const { data: departmentsData } = useQuery(someCondition ? departmentsFactory.innovationManagerList() : departmentsFactory.departmentLeaderList())

When I remove the someCondition and only use either one it works, but once it is a conditional it breaks. Any workaround?
Was this page helpful?