/**
 * Config row for the config_secrets_org_module, which provisions an organization-scoped encrypted key-value secrets store with manage_secrets permission and entity-membership RLS.
 * @generated by @constructive-io/graphql-codegen
 * DO NOT EDIT - changes will be overwritten
 */
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { getClient } from '../client';
import { buildSelectionArgs } from '../selection';
import { configSecretsOrgModuleKeys } from '../query-keys';
import { configSecretsOrgModuleMutationKeys } from '../mutation-keys';
export function useCreateConfigSecretsOrgModuleMutation(params) {
    const args = buildSelectionArgs(params.selection);
    const { selection: _selection, ...mutationOptions } = params ?? {};
    void _selection;
    const queryClient = useQueryClient();
    return useMutation({
        mutationKey: configSecretsOrgModuleMutationKeys.create(),
        mutationFn: (data) => getClient()
            .configSecretsOrgModule.create({
            data,
            select: args.select,
        })
            .unwrap(),
        onSuccess: () => {
            queryClient.invalidateQueries({
                queryKey: configSecretsOrgModuleKeys.lists(),
            });
        },
        ...mutationOptions,
    });
}
