Skip to content

When dispatchPredicate condition evaluates to false, shouldDispatch should return false #138

Closed
@srinivasankavitha

Description

@srinivasankavitha

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions