Skip to content

Commit adbe2f7

Browse files
committed
fail fast in api gw load()
1 parent f775d25 commit adbe2f7

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

packages/cubejs-api-gateway/src/gateway.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,7 +1556,7 @@ class ApiGateway {
15561556
}
15571557

15581558
/**
1559-
* Convert adapter's result and other request paramters to a final
1559+
* Convert adapter's result and other request parameters to a final
15601560
* result object.
15611561
* @internal
15621562
*/
@@ -1699,6 +1699,17 @@ class ApiGateway {
16991699
const [queryType, normalizedQueries] =
17001700
await this.getNormalizedQueries(query, context);
17011701

1702+
if (
1703+
queryType !== QueryTypeEnum.REGULAR_QUERY &&
1704+
props.queryType == null
1705+
) {
1706+
throw new UserError(
1707+
`'${queryType
1708+
}' query type is not supported by the client.` +
1709+
'Please update the client.'
1710+
);
1711+
}
1712+
17021713
let metaConfigResult = await (await this
17031714
.getCompilerApi(context)).metaConfig(request.context, {
17041715
requestId: context.requestId
@@ -1760,17 +1771,6 @@ class ApiGateway {
17601771
context,
17611772
);
17621773

1763-
if (
1764-
queryType !== QueryTypeEnum.REGULAR_QUERY &&
1765-
props.queryType == null
1766-
) {
1767-
throw new UserError(
1768-
`'${queryType
1769-
}' query type is not supported by the client.` +
1770-
'Please update the client.'
1771-
);
1772-
}
1773-
17741774
if (props.queryType === 'multi') {
17751775
res({
17761776
queryType,

0 commit comments

Comments
 (0)