// (C) 2022-2026 GoodData Corporation
import { call } from "redux-saga/effects";
import { serializeObjRef } from "@gooddata/sdk-model";
import { createCachedQueryService } from "../store/_infra/queryService.js";
export const QueryConnectedAttributesService = createCachedQueryService("GDC.DASH/QUERY.CONNECTED.ATTRIBUTES", queryService, (query) => {
    const { payload: { ref }, } = query;
    return serializeObjRef(ref);
});
async function loadConnectedAttributes(ctx, ref) {
    const { backend, workspace } = ctx;
    return await backend.workspace(workspace).attributes().getConnectedAttributesByDisplayForm(ref);
}
function* queryService(ctx, query) {
    const { payload: { ref }, } = query;
    const connectedAttributes = yield call(loadConnectedAttributes, ctx, ref);
    return connectedAttributes;
}
//# sourceMappingURL=queryConnectedAttributes.js.map