Skip to content

Query handler breaking the dependency rule? #79

@thatguysimon

Description

@thatguysimon

Hi @Sairyss!
Thanks for this awesome repo! It's been super helpful. I did encounter an issue recently though -

According to the readme - queries should be part of the application layer. But when looking at find-users.query-handler.ts, we can see it's importing dependencies from an outer layer - the infrastructure layer (like slonik and user.repository).

Doesn't that break the dependency rule? Or am I missing something?
If queries are at the same layer as application services, shouldn't they be required to use ports to communicate to "the outside world" just like application services are required to?

Thanks!
Simon

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions