MCPcopy Index your code
hub / github.com/TanStack/query / Mutate

Function Mutate

packages/solid-query/src/__tests__/useMutationState.test.tsx:39–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37 }
38
39 function Mutate() {
40 const mutation = useMutation(() => ({
41 mutationKey,
42 mutationFn: async (input: number) => {
43 await sleep(150)
44 return 'data' + input
45 },
46 }))
47
48 return (
49 <div>
50 data: {mutation.data ?? 'null'}
51 <button onClick={() => mutation.mutate(1)}>mutate</button>
52 </div>
53 )
54 }
55
56 function Page() {
57 return (

Callers

nothing calls this directly

Calls 3

sleepFunction · 0.90
useMutationFunction · 0.50
mutateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…