cube-js / cube

📊 Cube — Universal semantic layer platform for AI, BI, spreadsheets, and embedded analytics
https://cube.dev
Other
17.97k stars 1.78k forks source link

How to forcefully refetch the data without changing the query in queryrenderer #483

Closed rasheedk closed 3 years ago

rasheedk commented 4 years ago

Cube js<QueryRenderer />component data not updated when component re renders even I have given renewQuery: true in query.

How can i refetch data again (Force refresh) from server without changing the query in Query renderer?

paveltiunov commented 4 years ago

@rasheedk Hey Rasheed! Could you please share schema of a cube you're trying to refresh? And what version of Cube.js do you use?

rasheedk commented 4 years ago

@paveltiunov I am using Cube version 0.17.0

`
cube(`OpportunityByCategory`, {
  sql: `SELECT * FROM pricing_opportunity_by_category`,
  title:` `,
  description: `This chart shows  test data`,
   refreshKey: {
    every: `10 second`
  },
  joins: {

  },

  measures: {
    measure1: {
      type: `max`,
      title:`Measure1`,
      sql:`repair`
    },
   measure2: {
      type: `max`,
      title:`measure2`,
      sql:`maintenance`
    }
  },

  dimensions: {
     date: {
      sql: `createdDate`,
      type: `time`
    }
  }
});

`
paveltiunov commented 4 years ago

@rasheedk Could you please update to the latest version and see if it changes something for you?

Also could you please try to enable https://cube.dev/docs/@cubejs-backend-server-core#options-reference-scheduled-refresh-timer

ifokeev commented 4 years ago

@paveltiunov having this issue too. Scheduled refresh doesn't work as expected. Getting Cache issues too often. renewQuery doesn't update the query in runtime.

Tried to set refreshKeyRenewalThreshold: 1. Will back with the result

paveltiunov commented 3 years ago

Should be fixed in the latest versions. Please feel free to open a new issue if it still persists.