/**
 * Create mutation hook for OrgGetManagersRecord
 * @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 { orgGetManagersRecordKeys } from '../query-keys';
import { orgGetManagersRecordMutationKeys } from '../mutation-keys';
export function useCreateOrgGetManagersRecordMutation(params) {
    const args = buildSelectionArgs(params.selection);
    const { selection: _selection, ...mutationOptions } = params ?? {};
    void _selection;
    const queryClient = useQueryClient();
    return useMutation({
        mutationKey: orgGetManagersRecordMutationKeys.create(),
        mutationFn: (data) => getClient()
            .orgGetManagersRecord.create({
            data,
            select: args.select,
        })
            .unwrap(),
        onSuccess: () => {
            queryClient.invalidateQueries({
                queryKey: orgGetManagersRecordKeys.lists(),
            });
        },
        ...mutationOptions,
    });
}
