You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To better explain the situation, there's a list that's empty on load and where new items are manually added to it. When each new item is added to the list a query has to make a call to fetch some data. The thing is that each new item would need to trigger a new query, but also to keep the previous data.
As I can see, that can be done by using InfiniteQueries, but the thing with that is that if there are a lot of products added and data become stale I don't want to run all the queries separately (as I understand that's how the infinite queries work), but would prefer to make one call to refresh data of all items at once. What's the best way to accomplish that?
The flow would be:
Start with an empty list
Add item A to the list
Trigger query to fetch data for item A
Add item B to the list
Trigger query to fetch data for item B only, but also keep the item A data
When data becomes stale fetch data for item A and B (all items in the list) in one query
Ideally, but also not mandatory as I think it would make things a lot more complex, is possibility to batch queries of 20 items. Meaning, if 30 products were added to the list that would make two query calls when data becomes stale, one with 20 items and the other one with 10 items.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
To better explain the situation, there's a list that's empty on load and where new items are manually added to it. When each new item is added to the list a query has to make a call to fetch some data. The thing is that each new item would need to trigger a new query, but also to keep the previous data.
As I can see, that can be done by using InfiniteQueries, but the thing with that is that if there are a lot of products added and data become stale I don't want to run all the queries separately (as I understand that's how the infinite queries work), but would prefer to make one call to refresh data of all items at once. What's the best way to accomplish that?
The flow would be:
Ideally, but also not mandatory as I think it would make things a lot more complex, is possibility to batch queries of 20 items. Meaning, if 30 products were added to the list that would make two query calls when data becomes stale, one with 20 items and the other one with 10 items.
Help is much appreciated!
Beta Was this translation helpful? Give feedback.
All reactions