/**
 * Installed resource bundle ("release") — groups a set of resources; params are merkle-versioned in the scope's shared infra store for rollback
 * @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 { resourceInstallationKeys } from '../query-keys';
import { resourceInstallationMutationKeys } from '../mutation-keys';
export function useCreateResourceInstallationMutation(params) {
    const args = buildSelectionArgs(params.selection);
    const { selection: _selection, ...mutationOptions } = params ?? {};
    void _selection;
    const queryClient = useQueryClient();
    return useMutation({
        mutationKey: resourceInstallationMutationKeys.create(),
        mutationFn: (data) => getClient()
            .resourceInstallation.create({
            data,
            select: args.select,
        })
            .unwrap(),
        onSuccess: () => {
            queryClient.invalidateQueries({
                queryKey: resourceInstallationKeys.lists(),
            });
        },
        ...mutationOptions,
    });
}
