// (C) 2007-2019 GoodData Corporation import { ExecuteAFM as AFM } from "@gooddata/typings"; export function getDefaultResultSpec(afm: AFM.IAfm): AFM.IResultSpec { if (afm.measures.length && afm.attributes.length) { return { dimensions: [ { itemIdentifiers: ["measureGroup"], }, { itemIdentifiers: afm.attributes.map(attribute => attribute.localIdentifier), }, ], }; } return { dimensions: [ { itemIdentifiers: ["measureGroup"], }, ], }; }