Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mattyocyb opened this issue Jan 29, 2025 · 0 comments

Comments

@mattyocyb
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant