TanStackT
TanStack2y ago
5 replies
clean-aquamarine

executing enabled false query

export function getAssistantOptions(id: string | null) {
  return queryOptions({
    queryKey: ['assistant', id],
    queryFn: () => console.log('log'),
    enabled: false,
  })
}


this still execute and shows 'log' in terminal. Using it with a useSuspense() call

  const { data: assistant } = useSuspenseQuery(getAssistantOptions(id))
Was this page helpful?