MCPcopy Create free account
hub / github.com/AIScientists-Dev/Flowtrace / makeRunMutation

Function makeRunMutation

frontend/src/features/trace/api/trace-core.ts:209–227  ·  view source on GitHub ↗
(
  buildPath: (runId: string, vars: RunMutationVars) => string,
  method: HttpMethod = 'POST',
)

Source from the content-addressed store, hash-verified

207}
208
209function makeRunMutation(
210 buildPath: (runId: string, vars: RunMutationVars) => string,
211 method: HttpMethod = 'POST',
212) {
213 return function useRunMutation(runId: string) {
214 const qc = useQueryClient()
215 return useMutation({
216 mutationFn: (vars: RunMutationVars) => {
217 const path = buildPath(runId, vars)
218 return method === 'PATCH'
219 ? apiClient.patch(path, vars.body)
220 : apiClient.post(path, vars.body)
221 },
222 onSuccess: () => {
223 void qc.invalidateQueries({ queryKey: traceKeys.run(runId) })
224 },
225 })
226 }
227}
228
229export type StatusKind = 'idle' | 'running' | 'blocked' | 'done' | 'error'
230

Callers 1

trace-core.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…