Skip to content

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

@mattyocyb

Description

@mattyocyb

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions