(
workflowId: string | undefined,
blockId: string | undefined,
options?: { enabled?: boolean }
)
| 118 | * Hook to fetch schedule data for a workflow block |
| 119 | */ |
| 120 | export function useScheduleQuery( |
| 121 | workflowId: string | undefined, |
| 122 | blockId: string | undefined, |
| 123 | options?: { enabled?: boolean } |
| 124 | ) { |
| 125 | return useQuery({ |
| 126 | queryKey: scheduleKeys.schedule(workflowId ?? '', blockId ?? ''), |
| 127 | queryFn: ({ signal }) => fetchSchedule(workflowId!, blockId!, signal), |
| 128 | enabled: !!workflowId && !!blockId && (options?.enabled ?? true), |
| 129 | staleTime: 30 * 1000, // 30 seconds |
| 130 | retry: false, |
| 131 | placeholderData: keepPreviousData, |
| 132 | }) |
| 133 | } |
| 134 | |
| 135 | /** |
| 136 | * Hook to get processed schedule info with human-readable timing |
no test coverage detected