Skip to content

Filtering by nested entity's id leads to an unnecessary join #1250

Description

@ln-e

For exampe I have 3 entities relation like offer => product => category.

According to documentation i can filter on nested properties like so:

    offer.numeric_filter:
        parent:    'api_platform.doctrine.orm.numeric_filter'
        arguments: [ { product.color: ~ } ]
        tags:      [ { name: 'api_platform.filter', id: 'offer.numeric' } ]

If I want to get all offers where it is in the category with id = 1, I can't filter like product.category this doesn't work.
I have to write product.category.id. And it works, but this leads to an extra table join.
In such case I thinks that product.category can be just filtered like regular column.

api-platfrom/core: v2.1.0-beta.1

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