Skip to content

Commit 9a8dc4e

Browse files
committed
fix prepareDepsGraph()
1 parent bc049ef commit 9a8dc4e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

packages/cubejs-schema-compiler/src/compiler/CubeSymbols.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,19 @@ export class CubeSymbols {
123123
graph.set(`${cube.name}-none`, [{ cubeDef: cube, name: cube.name }]);
124124
} else {
125125
cube.cubes?.forEach(c => {
126-
const jp = c.joinPath || c.join_path;
126+
const jp = c.joinPath || c.join_path; // View is not camelized yet
127127
if (jp) {
128128
// It's enough to ref the very first level, as everything else will be evaluated on its own
129-
const cubeJoinPath = this.funcArguments(jp)[0]; // View is not camelized yet
129+
let cubeJoinPath;
130+
const fa = this.funcArguments(jp);
131+
if (fa?.length > 0) {
132+
[cubeJoinPath] = fa;
133+
} else { // It's a function without params so it's safe to call it without further processing
134+
const res = jp.apply(null);
135+
if (typeof res === 'string') {
136+
[cubeJoinPath] = res.split('.');
137+
}
138+
}
130139
graph.set(`${cube.name}-${cubeJoinPath}`, [{ cubeDef: cube, name: cube.name }, { name: cubeJoinPath }]);
131140
}
132141
});

0 commit comments

Comments
 (0)