• Creates a well-known query builder for use inside RTK Query queryFn.

    Constructs a request object from the URL, then exposes applyQuery to execute the request through the caller's baseQuery. Response validation uses isValidWellknownResponse.

    Parameters

    • url: string

      The well-known endpoint URL

    Returns {
        applyQuery(
            callback: QueryCallback,
        ): Promise<WellknownQueryResult<WellknownResponse>>;
    }

    A builder with applyQuery(callback) that returns a result compatible with RTK Query's QueryReturnValue

    queryFn: async (url, _api, _extra, baseQuery) => {
    return initWellknownQuery(url).applyQuery(async (req) => await baseQuery(req));
    }