/**
 * Webhook route authority: (host, path) -> function task_identifier invoked through the webhook channel, with provider, signing-secret reference, and replay window
 * @generated by @constructive-io/graphql-codegen
 * DO NOT EDIT - changes will be overwritten
 */
import { useQuery } from '@tanstack/react-query';
import { getClient } from '../client';
import { buildListSelectionArgs } from '../selection';
import { platformWebhookEndpointKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const platformWebhookEndpointsQueryKey = platformWebhookEndpointKeys.list;
export function usePlatformWebhookEndpointsQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: platformWebhookEndpointKeys.list(args),
        queryFn: () => getClient().platformWebhookEndpoint.findMany(args).unwrap(),
        ...queryOptions,
    });
}
export async function fetchPlatformWebhookEndpointsQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    return getClient().platformWebhookEndpoint.findMany(args).unwrap();
}
export async function prefetchPlatformWebhookEndpointsQuery(queryClient, params) {
    const args = buildListSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: platformWebhookEndpointKeys.list(args),
        queryFn: () => getClient().platformWebhookEndpoint.findMany(args).unwrap(),
    });
}
