/**
 * Config row for the session_secrets_module, which provisions a DB-private, session-scoped ephemeral key-value store for challenges, nonces, and one-time tokens that must never be readable by end users.
 * @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 { sessionSecretsModuleKeys } from '../query-keys';
import { sessionSecretsModuleMutationKeys } from '../mutation-keys';
export function useCreateSessionSecretsModuleMutation(params) {
    const args = buildSelectionArgs(params.selection);
    const { selection: _selection, ...mutationOptions } = params ?? {};
    void _selection;
    const queryClient = useQueryClient();
    return useMutation({
        mutationKey: sessionSecretsModuleMutationKeys.create(),
        mutationFn: (data) => getClient()
            .sessionSecretsModule.create({
            data,
            select: args.select,
        })
            .unwrap(),
        onSuccess: () => {
            queryClient.invalidateQueries({
                queryKey: sessionSecretsModuleKeys.lists(),
            });
        },
        ...mutationOptions,
    });
}
