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
Is it expected that we always set an explicit overall dispatch predicate (different from DISPATCH_ALWAYS) that would serve as a backup? Currently I have to set it to either DISPATCH_NEVER or some other reasonable default that would eventually be applied so that the individual data loader dispatch predicates get a chance to be applied.
The text was updated successfully, but these errors were encountered:
I think you are right - the current code does a fall back to an overall DispatchPredicate if it never returns true but looking at it now on reflection, if there is a specific DispatchPredicate registered for a DataLoader it should take precedence and be the final answer. After all it was specifically set on that data loader.
Describe the bug
The default policy when using ScheduledDispatchRegistry is DISPATCH_ALWAYS. However, when a dispatch predicate is set for a data loader, the shouldDispatch method should return false if the condition evaluates to false. Current behavior is that it falls through to the overall DISPATCH_ALWAYS predicate when the dataloader's dispatch predicate evaluates to false: https://github.com/graphql-java/java-dataloader/blob/master/src/main/java/org/dataloader/registries/ScheduledDataLoaderRegistry.java#L219
Is it expected that we always set an explicit overall dispatch predicate (different from DISPATCH_ALWAYS) that would serve as a backup? Currently I have to set it to either DISPATCH_NEVER or some other reasonable default that would eventually be applied so that the individual data loader dispatch predicates get a chance to be applied.
The text was updated successfully, but these errors were encountered: