question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Variable recalculation for each polling request

See original GitHub issue

Intended outcome: Use query polling option and recalculate variables for every request.

Actual outcome: We have a time deppendend query variable, this variable is not propagated from the props, but it is calculated from current time in the query options function. But it’s not recalculated when a new polling request is throwed. Is there a way how to enforce variables recalculation please?

const config = {
 options: (props) => {
     const { base } = props;
     // a dynamic variable calculated from current time, it is not recalculated
     const  from =  new Date().getTime() - base; 
     const variables = { from};
     const pollInterval = 5000;
     return { variables, pollInterval };
  }
};

How to reproduce the issue: https://codesandbox.io/s/q3mjxyw7zw I tried to simplify the issue and create a simple config with a current time dependend variable. This variable is not recalculated.

Version

  • apollo-client@2.2.5

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:10
  • Comments:19 (1 by maintainers)

github_iconTop GitHub Comments

15reactions
ethanIncentifycommented, Feb 19, 2020

Can we revisit this issue? I have a dynamic variable that needs to be set at each pollingInterval.

8reactions
Forfoldcommented, May 7, 2018

Any update on this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How is Polling Load Calculated? - SolarWinds THWACK
We need the detail behind the polling rate calculation so we can understand specifically which variable has the most effect eg. node/interface element ......
Read more >
Will frequent polling overload the server? If so, what's the best ...
Every Ajax poll request that is made will contain output_hash which is the digest of the data returned by the server previously.
Read more >
R Calculation Server Design - PI Square - OSIsoft
Provide rolling windows for one or more variables; Sample the stream based on the polling rate; polling rate = 0 would be event...
Read more >
Practical Guidance on Calculating Sampling Error in Election ...
In election poll results, the proportions favoring candidates and the ... the calculation steps in STATA and SPSS programs to handle polls ......
Read more >
Refresh command (TMSL) | Microsoft Learn
Request ; full, Database, Table, Partition, For all partitions in the specified partition, table, or database, refresh data and recalculate all ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found