MCPcopy
hub / github.com/daeuniverse/daed / useSetJsonStorageMutation

Function useSetJsonStorageMutation

apps/web/src/apis/mutation.ts:18–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16import { graphql } from '~/schemas/gql'
17
18export function useSetJsonStorageMutation() {
19 const gqlClient = useGQLQueryClient()
20
21 return useMutation({
22 mutationFn: (object: Record<string, string>) => {
23 const paths = Object.keys(object)
24 const values = paths.map((path) => object[path])
25
26 return gqlClient.request(
27 graphql(`
28 mutation SetJsonStorage($paths: [String!]!, $values: [String!]!) {
29 setJsonStorage(paths: $paths, values: $values)
30 }
31 `),
32 {
33 paths,
34 values,
35 },
36 )
37 },
38 })
39}
40
41export function useSetModeMutation() {
42 const gqlClient = useGQLQueryClient()

Callers 1

useInitializeFunction · 0.90

Calls 3

useGQLQueryClientFunction · 0.90
graphqlFunction · 0.90
requestMethod · 0.80

Tested by

no test coverage detected