Skip to content

Bug: 'where' filter on nested many-to-one not working #77

Closed
@molexx

Description

@molexx

It seems where clauses on a nested many-to-one relationship are ignored.

I've updated the example app to demonstrate the problem. There aren't enough '-to-one' relationships available in the example model to recreate so I've added a new one - a Droid's PrimaryFunction replacing String primaryFunction:

https://github.com/molexx/graphql-jpa-query/tree/filterNestedManyToOne/graphql-jpa-query-example/src/main/java/com/introproventures/graphql/jpa/query/example/model

This simpler example works - only the Astromech is returned:

query {
    Droids {
        select {
            name
            primaryFunction(where:{function:{EQ:"Astromech"}}) {
                function
            }
        }
    }
}

But this one doesn't - the Protocol droid is also returned:

query {
    Humans {
        select {
            id
            name
            homePlanet
            favoriteDroid {
                name
                primaryFunction(where:{function:{EQ:"Astromech"}}) {
                      function
                }
            }
        }
    }
}

I've also applied the model changes to graphql-jpa-query-schema's tests and added the above two examples as tests - the second one currently fails as the Protocol droid and its parent Luke Skywalker should not be returned.

https://github.com/molexx/graphql-jpa-query/blob/796b6488da4ece90b5ec705b097c0462740180fd/graphql-jpa-query-schema/src/test/java/com/introproventures/graphql/jpa/query/schema/StarwarsQueryExecutorTests.java#L615

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions