Commit e1a2cfa
authored
fix(api-gateway): Handle array format for joins in /meta?extended endpoint (#9881)
* fix(api-gateway): Handle array format for joins in /meta?extended endpoint
After PR #9800, joins are stored as arrays instead of objects in the
schema compiler. The transformJoins function in the API gateway was
still using Object.entries() which, when applied to arrays, returns
numeric indices as keys instead of actual join names.
This fix:
- Checks if joins is an array and preserves the name property
- Maintains backward compatibility with object format
- Adds test coverage for both array and object formats
Fixes the issue where join names appear as "0", "1", "2" instead of
their actual names in the /meta?extended endpoint response.
* Extract the duplicate transformation logic into a local transformJoin function1 parent 8ddaba5 commit e1a2cfa
File tree
2 files changed
+35
-3
lines changed- packages/cubejs-api-gateway
- src/helpers
- test/helpers
2 files changed
+35
-3
lines changedLines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
87 | 95 | | |
88 | 96 | | |
89 | 97 | | |
| |||
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
222 | 246 | | |
223 | 247 | | |
224 | 248 | | |
| |||
0 commit comments