/**
 * Cache invalidation helpers
 * @generated by @constructive-io/graphql-codegen
 * DO NOT EDIT - changes will be overwritten
 */
import { commitKeys, getAllTreeNodesRecordKeys, objectKeys, refKeys, storeKeys, } from './query-keys';
/**
// ============================================================================
// Invalidation Helpers
// ============================================================================

 * Type-safe query invalidation helpers
 *
 * @example
 * ```ts
 * // Invalidate all user queries
 * invalidate.user.all(queryClient);
 *
 * // Invalidate user lists
 * invalidate.user.lists(queryClient);
 *
 * // Invalidate specific user
 * invalidate.user.detail(queryClient, userId);
 * ```
 */
export const invalidate = {
    /** Invalidate commit queries */ commit: {
        /** Invalidate all commit queries */ all: (queryClient) => queryClient.invalidateQueries({
            queryKey: commitKeys.all,
        }),
        /** Invalidate commit list queries */ lists: (queryClient) => queryClient.invalidateQueries({
            queryKey: commitKeys.lists(),
        }),
        /** Invalidate a specific commit */ detail: (queryClient, id) => queryClient.invalidateQueries({
            queryKey: commitKeys.detail(id),
        }),
    },
    /** Invalidate getAllTreeNodesRecord queries */ getAllTreeNodesRecord: {
        /** Invalidate all getAllTreeNodesRecord queries */ all: (queryClient) => queryClient.invalidateQueries({
            queryKey: getAllTreeNodesRecordKeys.all,
        }),
        /** Invalidate getAllTreeNodesRecord list queries */ lists: (queryClient) => queryClient.invalidateQueries({
            queryKey: getAllTreeNodesRecordKeys.lists(),
        }),
        /** Invalidate a specific getAllTreeNodesRecord */ detail: (queryClient, id) => queryClient.invalidateQueries({
            queryKey: getAllTreeNodesRecordKeys.detail(id),
        }),
    },
    /** Invalidate object queries */ object: {
        /** Invalidate all object queries */ all: (queryClient) => queryClient.invalidateQueries({
            queryKey: objectKeys.all,
        }),
        /** Invalidate object list queries */ lists: (queryClient) => queryClient.invalidateQueries({
            queryKey: objectKeys.lists(),
        }),
        /** Invalidate a specific object */ detail: (queryClient, id) => queryClient.invalidateQueries({
            queryKey: objectKeys.detail(id),
        }),
    },
    /** Invalidate ref queries */ ref: {
        /** Invalidate all ref queries */ all: (queryClient) => queryClient.invalidateQueries({
            queryKey: refKeys.all,
        }),
        /** Invalidate ref list queries */ lists: (queryClient) => queryClient.invalidateQueries({
            queryKey: refKeys.lists(),
        }),
        /** Invalidate a specific ref */ detail: (queryClient, id) => queryClient.invalidateQueries({
            queryKey: refKeys.detail(id),
        }),
    },
    /** Invalidate store queries */ store: {
        /** Invalidate all store queries */ all: (queryClient) => queryClient.invalidateQueries({
            queryKey: storeKeys.all,
        }),
        /** Invalidate store list queries */ lists: (queryClient) => queryClient.invalidateQueries({
            queryKey: storeKeys.lists(),
        }),
        /** Invalidate a specific store */ detail: (queryClient, id) => queryClient.invalidateQueries({
            queryKey: storeKeys.detail(id),
        }),
    },
};
/**

// ============================================================================
// Remove Helpers (for delete operations)
// ============================================================================

 * Remove queries from cache (for delete operations)
 *
 * Use these when an entity is deleted to remove it from cache
 * instead of just invalidating (which would trigger a refetch).
 */
export const remove = {
    /** Remove commit from cache */ commit: (queryClient, id) => {
        queryClient.removeQueries({
            queryKey: commitKeys.detail(id),
        });
    },
    /** Remove getAllTreeNodesRecord from cache */ getAllTreeNodesRecord: (queryClient, id) => {
        queryClient.removeQueries({
            queryKey: getAllTreeNodesRecordKeys.detail(id),
        });
    },
    /** Remove object from cache */ object: (queryClient, id) => {
        queryClient.removeQueries({
            queryKey: objectKeys.detail(id),
        });
    },
    /** Remove ref from cache */ ref: (queryClient, id) => {
        queryClient.removeQueries({
            queryKey: refKeys.detail(id),
        });
    },
    /** Remove store from cache */ store: (queryClient, id) => {
        queryClient.removeQueries({
            queryKey: storeKeys.detail(id),
        });
    },
};
