()
| 16 | import { graphql } from '~/schemas/gql' |
| 17 | |
| 18 | export 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 | |
| 41 | export function useSetModeMutation() { |
| 42 | const gqlClient = useGQLQueryClient() |
no test coverage detected