Skip to content

Paginator class depends on internal state #853

Open
@piotrkreft

Description

@piotrkreft
Q A
Bug report? yes
Feature request? yes
BC Break report? no
RFC? no
Version/Branch 0.13

Class Overblog\GraphQLBundle\Relay\Connection\Paginator depends on internal totalCount state, if fetched already. I find this to be sort of an antipattern in several situations, especially when dealing with DI and class being a service as it brings an additional potential place of failure being harder to find in simple tests even.

Would you consider a change? If yes I'd obviously provide a suitable code for it.
If BC desired the solution could be configurable behavior via an optional constructor parameter though not sure whether it's a good practice tbh. Alternatively, an interface and cache decorator would be more suitable perhaps.

Best regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions