cube-js/cube · error · UserError

'${queryType}' query type is not supported by the client.Ple

Error message

'${queryType}' query type is not supported by the client.Please update the client.

What it means

When the submitted query resolves to a non-regular query type (e.g. a data blending array query, compare-date-range, or multi-query), the API response shape changes. Old clients that expect a plain ResultSet cannot handle it, so ApiGateway throws this UserError unless the client explicitly signals support via `queryType`. It protects clients from receiving a payload format they cannot parse.

Source

Thrown at packages/cubejs-api-gateway/src/gateway.ts:2126

      if (!Array.isArray(query) && query.responseFormat) {
        resType = query.responseFormat;
      }

      this.log({
        type: 'Load Request',
        apiType,
        query
      }, context);

      const [queryType, normalizedQueries] =
        await this.getNormalizedQueries(query, context, false, false, cacheMode);

      if (
        queryType !== QueryTypeEnum.REGULAR_QUERY &&
        props.queryType == null
      ) {
        throw new UserError(
          `'${queryType
          }' query type is not supported by the client.` +
          'Please update the client.'
        );
      }

      let metaConfigResult = await (await this
        .getCompilerApi(context)).metaConfig(request.context, {
        requestId: context.requestId
      });

      metaConfigResult = this.filterVisibleItemsInMeta(context, metaConfigResult);

      const sqlQueries = await this.getSqlQueriesInternal(context, normalizedQueries);

      let slowQuery = false;

      const results = await Promise.all(

View on GitHub (pinned to 7d981676b3)

Solutions

  1. Upgrade @cubejs-client/core (and framework wrappers) to a version that supports the query type and sends queryType.
  2. Explicitly pass queryType in the request (e.g. queryType: 'blendingQuery' when loading an array of queries).
  3. If the client can't be upgraded, split the request into separate regular queries and merge client-side.

Example fix

// before
await cubeApi.load([{ measures: ['a.c'] }, { measures: ['b.c'] }]); // old client, no queryType
// after
await cubeApi.load([{ measures: ['a.c'] }, { measures: ['b.c'] }], { queryType: 'blendingQuery' });
Defensive patterns

Strategy: type-guard

Validate before calling

const SUPPORTED = new Set(['regular', 'blendingQuery']);
if (Array.isArray(query) && !SUPPORTED.has(queryTypeSent)) throw new Error('Upgrade @cubejs-client or pass queryType explicitly for non-regular queries');

Type guard

function clientSupportsQueryType(res: unknown): res is { queryType: string } {
  return typeof res === 'object' && res !== null && 'queryType' in res;
}

Try / catch

try {
  return await cubeApi.load(query);
} catch (e) {
  if (String(e?.message).includes('query type is not supported by the client')) {
    console.error('Client too old for this query type — upgrade @cubejs-client/core');
    throw e;
  }
  throw e;
}

Prevention

When it happens

Trigger: POST /cubejs-api/v1/load with a blended/array query (or other non-REGULAR_QUERY type) from a client that did not set queryType — i.e. queryType !== REGULAR_QUERY and props.queryType == null. Sending queryType explicitly suppresses the error.

Common situations: Upgrading the server or data model to use data blending while the frontend still runs an older @cubejs-client/core that doesn't declare queryType; hand-rolled fetch calls to /load with array queries that bypass the official client; stale cached client bundles after a version upgrade.

Related errors


AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02). Data as JSON: /api/errors/f5a79febeaed07fd. Report an issue: GitHub.