/**
 * 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 { buildSelectionArgs } from '../selection';
import { platformWebhookEndpointKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const platformWebhookEndpointQueryKey = platformWebhookEndpointKeys.detail;
export function usePlatformWebhookEndpointQuery(params) {
    const args = buildSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: platformWebhookEndpointKeys.detail(params.id),
        queryFn: () => getClient()
            .platformWebhookEndpoint.findOne({
            id: params.id,
            select: args.select,
        })
            .unwrap(),
        ...queryOptions,
    });
}
export async function fetchPlatformWebhookEndpointQuery(params) {
    const args = buildSelectionArgs(params.selection);
    return getClient()
        .platformWebhookEndpoint.findOne({
        id: params.id,
        select: args.select,
    })
        .unwrap();
}
export async function prefetchPlatformWebhookEndpointQuery(queryClient, params) {
    const args = buildSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: platformWebhookEndpointKeys.detail(params.id),
        queryFn: () => getClient()
            .platformWebhookEndpoint.findOne({
            id: params.id,
            select: args.select,
        })
            .unwrap(),
    });
}
