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

Function useUpdateConfigMutation

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

Source from the content-addressed store, hash-verified

85}
86
87export function useUpdateConfigMutation() {
88 const gqlClient = useGQLQueryClient()
89 const queryClient = useQueryClient()
90
91 return useMutation({
92 mutationFn: ({ id, global }: { id: string; global: GlobalInput }) => {
93 return gqlClient.request(
94 graphql(`
95 mutation UpdateConfig($id: ID!, $global: globalInput!) {
96 updateConfig(id: $id, global: $global) {
97 id
98 }
99 }
100 `),
101 {
102 id,
103 global,
104 },
105 )
106 },
107 onSuccess: () => {
108 queryClient.invalidateQueries({ queryKey: QUERY_KEY_CONFIG })
109 queryClient.invalidateQueries({ queryKey: QUERY_KEY_GENERAL })
110 },
111 })
112}
113
114export function useRemoveConfigMutation() {
115 const gqlClient = useGQLQueryClient()

Callers 1

ConfigFormDrawerFunction · 0.90

Calls 3

useGQLQueryClientFunction · 0.90
graphqlFunction · 0.90
requestMethod · 0.80

Tested by

no test coverage detected