cube icon indicating copy to clipboard operation
cube copied to clipboard

Option to return `refreshKeyValue` when not in devMode or using Cube Playground

Open mattyocyb opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe. The refresh_key value would be helpful for us to use on our frontend to display as a data freshness metric. It's available when running Cube locally but is removed in production:

    const resObj = {
      query: normalizedQuery,
      lastRefreshTime: response.lastRefreshTime?.toISOString(),
      ...(
        getEnv('devMode') ||
          context.signedWithPlaygroundAuthSecret
          ? {
            refreshKeyValues: response.refreshKeyValues,
            usedPreAggregations: response.usedPreAggregations,
            transformedQuery: sqlQuery.canUseTransformedQuery,
            requestId: context.requestId,
          }
          : null
      ),

Describe the solution you'd like Would it be possible to add a context variable that optionally allows key-value pairs from the conditionally included object to be returned in production?

Describe alternatives you've considered This data can be retrieved via further queries from the frontend, but if many Cubes are being used to fetch data for a page, it introduces a lot more queries which are unnecessary when the data has already been retrieved but is being removed from the response.

mattyocyb avatar Jan 29 '25 16:01 mattyocyb

+1

pnedelko avatar Oct 29 '25 18:10 pnedelko