()
| 59 | } |
| 60 | |
| 61 | export function useCreateConfigMutation() { |
| 62 | const gqlClient = useGQLQueryClient() |
| 63 | const queryClient = useQueryClient() |
| 64 | |
| 65 | return useMutation({ |
| 66 | mutationFn: ({ name, global }: { name?: string; global?: GlobalInput }) => { |
| 67 | return gqlClient.request( |
| 68 | graphql(` |
| 69 | mutation CreateConfig($name: String, $global: globalInput) { |
| 70 | createConfig(name: $name, global: $global) { |
| 71 | id |
| 72 | } |
| 73 | } |
| 74 | `), |
| 75 | { |
| 76 | name, |
| 77 | global, |
| 78 | }, |
| 79 | ) |
| 80 | }, |
| 81 | onSuccess: () => { |
| 82 | queryClient.invalidateQueries({ queryKey: QUERY_KEY_CONFIG }) |
| 83 | }, |
| 84 | }) |
| 85 | } |
| 86 | |
| 87 | export function useUpdateConfigMutation() { |
| 88 | const gqlClient = useGQLQueryClient() |
no test coverage detected