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
Sometime we need to execute a query directly through the executor, make some mutations, and then execute the exact same query again so we get the updated result all in the same code execution. In this case the dataloader would not fetch data again for the second query but would get it directly from its internal cache. Normal behavior.
Instead of manually clearing the cache each time developers have to implement this type of use case, I'd like to automatically clear the dataloader cache between each query execution.
My first thought would be to create an event listener on the pre_executor event which would clear the cache on all the dataloader services.
Is there a better and recommended way to achieve this?
Is there a way to apply this only when the query was not initiated through HTTP?
Thanks!
The text was updated successfully, but these errors were encountered:
Sometime we need to execute a query directly through the executor, make some mutations, and then execute the exact same query again so we get the updated result all in the same code execution. In this case the dataloader would not fetch data again for the second query but would get it directly from its internal cache. Normal behavior.
Instead of manually clearing the cache each time developers have to implement this type of use case, I'd like to automatically clear the dataloader cache between each query execution.
My first thought would be to create an event listener on the
pre_executor
event which would clear the cache on all the dataloader services.Is there a better and recommended way to achieve this?
Is there a way to apply this only when the query was not initiated through HTTP?
Thanks!
The text was updated successfully, but these errors were encountered: