MCPcopy Index your code
hub / github.com/simstudioai/sim / usePauseContextDetail

Function usePauseContextDetail

apps/sim/hooks/queries/resume-execution.ts:132–151  ·  view source on GitHub ↗
(workflowId: string, executionId: string, contextId?: string)

Source from the content-addressed store, hash-verified

130 * no longer exists (404). `staleTime: 0` because pause state is live.
131 */
132export function usePauseContextDetail(workflowId: string, executionId: string, contextId?: string) {
133 return useQuery({
134 queryKey: resumeKeys.context(workflowId, executionId, contextId),
135 queryFn: async ({ signal }): Promise<PauseContextDetail | null> => {
136 try {
137 const raw = await requestJson(getPauseContextDetailContract, {
138 params: { workflowId, executionId, contextId: contextId as string },
139 signal,
140 })
141 // double-cast-allowed: contract models the pause point as z.record; the resume UI uses the richer PauseContextDetail interface
142 return raw as unknown as PauseContextDetail
143 } catch (error) {
144 if (isApiClientError(error) && error.status === 404) return null
145 throw error
146 }
147 },
148 enabled: Boolean(workflowId && executionId && contextId),
149 staleTime: 0,
150 })
151}
152
153/**
154 * Submits a resume for a pause context and invalidates the execution + context

Callers 1

ResumeExecutionPageFunction · 0.90

Calls 2

requestJsonFunction · 0.90
isApiClientErrorFunction · 0.90

Tested by

no test coverage detected