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
It appears that when GQL Subscriptions are used, the data returned by dataloaders will remain stale for the duration of the subscription.
I believe this happens because the context is the same for the lifetime of the subscription, so once data gets initially cached, it keeps returning the same initial result for DataLoader-resolved fields.
Manually clearing the cache by injecting the Loader and calling loader.clearAll() prior to returning from the @Subscription() method seems to work. This can be tricky to do depending on how many loaders are used and where they are defined, and is prone to bugs by forgetting to clear something.
The text was updated successfully, but these errors were encountered:
It appears that when GQL Subscriptions are used, the data returned by dataloaders will remain stale for the duration of the subscription.
I believe this happens because the context is the same for the lifetime of the subscription, so once data gets initially cached, it keeps returning the same initial result for DataLoader-resolved fields.
Manually clearing the cache by injecting the Loader and calling
loader.clearAll()
prior to returning from the@Subscription()
method seems to work. This can be tricky to do depending on how many loaders are used and where they are defined, and is prone to bugs by forgetting to clear something.The text was updated successfully, but these errors were encountered: