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

Function useCreateConfigMutation

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

Source from the content-addressed store, hash-verified

59}
60
61export 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
87export function useUpdateConfigMutation() {
88 const gqlClient = useGQLQueryClient()

Callers 3

useInitializeFunction · 0.90
ConfigFormDrawerFunction · 0.90
ConfigFunction · 0.90

Calls 3

useGQLQueryClientFunction · 0.90
graphqlFunction · 0.90
requestMethod · 0.80

Tested by

no test coverage detected